Complex.FromPolarCoordinates(Double, Double) 메서드

정의

점의 극좌표에서 복소수를 만듭니다.

public:
 static System::Numerics::Complex FromPolarCoordinates(double magnitude, double phase);
public static System.Numerics.Complex FromPolarCoordinates(double magnitude, double phase);
static member FromPolarCoordinates : double * double -> System.Numerics.Complex
Public Shared Function FromPolarCoordinates (magnitude As Double, phase As Double) As Complex

매개 변수

magnitude
Double

원점(x축과 y축의 교집합)에서 숫자까지의 거리인 크기입니다.

phase
Double

선에서 가로 축까지의 각도인 위상(라디안 단위로 측정)입니다.

반품

복소수입니다.

예제

다음 예제에서는 이 메서드를 사용하여 FromPolarCoordinates 극좌표에 따라 복소수를 인스턴스화한 다음 해당 Magnitude 값과 Phase 속성의 값을 표시합니다.

using System;
using System.Numerics;

public class Example
{
   public static void Main()
   {
      Complex c1 = Complex.FromPolarCoordinates(10, 45 * Math.PI / 180);
      Console.WriteLine("{0}:", c1);
      Console.WriteLine("   Magnitude: {0}", Complex.Abs(c1));
      Console.WriteLine("   Phase:     {0} radians", c1.Phase);
      Console.WriteLine("   Phase      {0} degrees", c1.Phase * 180/Math.PI);
      Console.WriteLine("   Atan(b/a): {0}", Math.Atan(c1.Imaginary/c1.Real));
   }
}
// The example displays the following output:
//       (7.07106781186548, 7.07106781186547):
//          Magnitude: 10
//          Phase:     0.785398163397448 radians
//          Phase      45 degrees
//          Atan(b/a): 0.785398163397448
open System
open System.Numerics

let c1 = Complex.FromPolarCoordinates(10., 45. * Math.PI / 180.)
printfn $"{c1}:"
printfn $"   Magnitude: {Complex.Abs(c1)}"
printfn $"   Phase:     {c1.Phase} radians"
printfn $"   Phase      {c1.Phase * 180. / Math.PI} degrees"
printfn $"   Atan(b/a): {Math.Atan(c1.Imaginary / c1.Real)}"
// The example displays the following output:
//       (7.07106781186548, 7.07106781186547):
//          Magnitude: 10
//          Phase:     0.785398163397448 radians
//          Phase      45 degrees
//          Atan(b/a): 0.785398163397448
Imports System.Numerics

Module Example
   Public Sub Main()
      Dim c1 As Complex = Complex.FromPolarCoordinates(10, 45 * Math.Pi / 180)
      Console.WriteLine("{0}:", c1)
      Console.WriteLine("   Magnitude: {0}", Complex.Abs(c1))
      Console.WriteLine("   Phase:     {0} radians", c1.Phase)
      Console.WriteLine("   Phase      {0} degrees", c1.Phase * 180/Math.Pi)
      Console.WriteLine("   Atan(b/a): {0}", Math.Atan(c1.Imaginary/c1.Real))
   End Sub
End Module
' The example displays the following output:
'       (7.07106781186548, 7.07106781186547):
'          Magnitude: 10
'          Phase:     0.785398163397448 radians
'          Phase      45 degrees
'          Atan(b/a): 0.785398163397448

설명

이 메서드는 FromPolarCoordinates 극좌표에 따라 복소수를 인스턴스화합니다.

복합 평면에 점의 여러 표현이 있으므로 메서드의 FromPolarCoordinates 반환 값이 정규화됩니다. 크기는 양수로 정규화되고 위상은 범위의PIPI값으로 정규화됩니다. 따라서 결과 복소수의 Phase 값과 Magnitude 속성 값이 원래 값 magnitudephase 매개 변수와 같지 않을 수 있습니다.

매개 변수의 값을 도에서 라디안 phase 으로 변환하려면 $\frac{\pi}{180}$를 곱합니다.

적용 대상

추가 정보