C# Complex FromPolarCoordinates
Description
Complex FromPolarCoordinates
Creates a complex number
from a point's polar coordinates.
Syntax
Complex.FromPolarCoordinates
has the following syntax.
public static Complex FromPolarCoordinates(
double magnitude,
double phase
)
Parameters
Complex.FromPolarCoordinates
has the following parameters.
magnitude
- The magnitude, which is the distance from the origin (the intersection of the x-axis and the y-axis) to the number.phase
- The phase, which is the angle from the line to the horizontal axis, measured in radians.
Returns
Complex.FromPolarCoordinates
method returns A complex number.
Example
Creates a complex number from a point's polar coordinates.
using System;// w w w . j av a 2 s . c o m
using System.Numerics;
public class Example
{
public static void Main()
{
Complex c1 = Complex.FromPolarCoordinates(10, 45 * Math.PI / 180);
Console.WriteLine("{0}:", c1);
}
}
The code above generates the following result.