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))); }
/// <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)); }