Exemple #1
0
        public static PolarCoordinate CartesianToPolar(Vector2sb value)
        {
            double theta = Functions.Atan2(value.Y, value.X);

            if (theta < 0)
            {
                theta += 2 * Constants.Pi;
            }
            return(new PolarCoordinate(
                       theta,
                       (double)Functions.Sqrt(value.X * value.X + value.Y * value.Y)));
        }
Exemple #2
0
 /// <summary>
 /// Computes the argument (or phase) of a complex number and returns the result.
 /// </summary>
 /// <param name="value">A complex number.</param>
 /// <returns>The argument of value.</returns>
 public static double Argument(Complex value)
 {
     return(Functions.Atan2(value.B, value.A));
 }