atan method

Complex atan()

Arctangent

Compute the inverse tangent of this complex number.

Implements the formula:

atan(z) = (i/2) log((i + z)/(i - z))

Returns nan if either real or imaginary part of the input argument is NaN or infinite.

Implementation

Complex atan() {
  if (isNaN) return Complex.nan;

  return ((this + Complex.i) / (Complex.i - this)).log() * 0.5.imag;
}