acos method

Complex acos()

Arccosine

Compute the inverse cosine of this complex number.

Implements the formula:

acos(z) = -i (log(z + i (sqrt(1 - z^2))))

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

Implementation

Complex acos() {
  if (isNaN) return Complex.nan;
  return (this + (sqrt1z() * Complex.i)).log() * (-Complex.i);
}