sinh method

Complex sinh()

Hyperbolic sine

Compute the hyperbolic sine of this complex number.

Implements the formula:

sinh(a + bi) = sinh(a)cos(b)) + cosh(a)sin(b)i

where the (real) functions on the right-hand side are math.sin, math.cos, fastmath.cosh and fastmath.sinh.

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

Infinite values in real or imaginary parts of the input may result in infinite or NaN values returned in parts of the result.

Examples:

sinh(1 ± INFINITY i) = NaN + NaN i
sinh(±INFINITY + i) = ± INFINITY + INFINITY i
sinh(±INFINITY ± INFINITY i) = NaN + NaN i

Implementation

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

  final _real = fastmath.sinh(real) * math.cos(imaginary);
  final _imag = fastmath.cosh(real) * math.sin(imaginary);
  return Cartesian(_real, _imag);
}