共用方式為


Complex.Phase 屬性

定義

取得複數的階段。

public:
 property double Phase { double get(); };
public double Phase { get; }
member this.Phase : double
Public ReadOnly Property Phase As Double

屬性值

複數的階段,以弧度為單位。

範例

下列範例會使用 FromPolarCoordinates 方法來根據其極座標具現化複數,然後顯示其 MagnitudePhase 屬性的值。

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

備註

對於複數 a + bi,階段會計算為 Atan(b, a)

您可以透過複數平面上的笛卡兒座標或其極座標來識別複數。 複數的階段(自變數)是從原點(X 軸和 Y 軸的交集)繪製到複數所表示之點的線條實際座標軸的角度。 大小(由 Magnitude 屬性表示)是從原點到複數所表示點的距離。

您可以呼叫 FromPolarCoordinates 方法,根據其極座標而非笛卡兒座標來具現化複數。

若要將階段從弧度轉換成度,請將它乘以 $\frac{180}{\pi}$。

適用於

另請參閱