/**
  * <p>
  * Converts a complex number into polar notation.
  * </p>
  *
  * @param input Standard notation
  * @param output Polar notation
  */
 public static void convert(Complex_F64 input, ComplexPolar_F64 output)
 {
     output.r     = input.getMagnitude();
     output.theta = Math.Atan2(input.imaginary, input.real);
 }
 /**
  * Computes the N<sup>th</sup> root of a complex number in polar notation.  There are
  * N distinct N<sup>th</sup> roots.
  *
  * @param a Complex number
  * @param N The root's magnitude
  * @param k Specifies which root.  0 &le; k &lt; N
  * @param result Computed root
  */
 public static void root(ComplexPolar_F64 a, int N, int k, ComplexPolar_F64 result)
 {
     result.r     = Math.Pow(a.r, 1.0 / N);
     result.theta = (a.theta + 2.0 * k * UtilEjml.PI) / N;
 }
 /**
  * Computes the power of a complex number in polar notation
  *
  * @param a Complex number
  * @param N Power it is to be multiplied by
  * @param result Result
  */
 public static void pow(ComplexPolar_F64 a, int N, ComplexPolar_F64 result)
 {
     result.r     = Math.Pow(a.r, N);
     result.theta = N * a.theta;
 }
 /**
  * Division in polar notation.
  *
  * @param a Complex number in polar notation. Not modified.
  * @param b Complex number in polar notation. Not modified.
  * @param result Storage for output.
  */
 public static void divide(ComplexPolar_F64 a, ComplexPolar_F64 b, ComplexPolar_F64 result)
 {
     result.r     = a.r / b.r;
     result.theta = a.theta - b.theta;
 }
 /**
  * Division in polar notation.
  *
  * @param a Complex number in polar notation. Not modified.
  * @param b Complex number in polar notation. Not modified.
  * @param result Storage for output.
  */
 public static void multiply(ComplexPolar_F64 a, ComplexPolar_F64 b, ComplexPolar_F64 result)
 {
     result.r     = a.r * b.r;
     result.theta = a.theta + b.theta;
 }
 /**
  * <p>
  * Converts a complex number in polar notation into standard notation.
  * </p>
  *
  * @param input Standard notation
  * @param output Polar notation
  */
 public static void convert(ComplexPolar_F64 input, Complex_F64 output)
 {
     output.real      = input.r * (double)Math.Cos(input.theta);
     output.imaginary = input.r * (double)Math.Sin(input.theta);
 }