phase function

double phase(
  1. Complex<num, num> complex
)

the angle to the real axis of a line drawn from the point of origin (real,imaginary) returns NaN if one of complex values is NaN.

Implementation

double phase(Complex complex) {
  return math.atan2(complex.imaginary, complex.real);
}