Complex.FromPolarCoordinates(Double, Double) Methode

Definition

Erstellt eine komplexe Zahl aus den Polarkoordinaten eines Punkts.

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

Parameter

magnitude
Double

Die Größe, die die Entfernung vom Ursprung (dem Schnittpunkt der x-Achse mit der y-Achse) zur Zahl ist.

phase
Double

Die Phase, d. h. der Winkel von der Linie zur horizontalen Achse, gemessen im Bogenmaß.

Gibt zurück

Eine komplexe Zahl.

Beispiele

Im folgenden Beispiel wird die FromPolarCoordinates -Methode verwendet, um eine komplexe Zahl basierend auf ihren Polarkoordinaten zu instanziieren und dann den Wert ihrer Magnitude Eigenschaften und Phase anzuzeigen.

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
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

Hinweise

Die FromPolarCoordinates Methode instanziiert eine komplexe Zahl basierend auf ihren Polarkoordinaten.

Da es mehrere Darstellungen eines Punkts auf einer komplexen Ebene gibt, wird der Rückgabewert der FromPolarCoordinates Methode normalisiert. Die Größe wird auf eine positive Zahl normalisiert, und die Phase wird auf einen Wert im Bereich von -PI bis PInormalisiert. Daher können die Werte der Phase Eigenschaften und Magnitude der resultierenden komplexen Zahl nicht den ursprünglichen Werten der magnitude Parameter und phase entsprechen.

Um einen Wert von Grad in Bogenmaße für den phase Parameter zu konvertieren, multiplizieren Sie ihn mit Math.PI/180.

Gilt für:

Weitere Informationen