ComplexTrigonometricX<T extends Complex> extension

A collection for trigonometric for Complex

Sine

Compute the sine of this complex number.

Implements the formula:

sin(a + bi) = sin(a)cosh(b) - cos(a)sinh(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:

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

Cosine

Compute the cosine of this complex number.

Implements the formula:

cos(a + bi) = cos(a)cosh(b) - sin(a)sinh(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:

cos(1 ± INFINITY i) = 1 ∓ INFINITY i
cos(±INFINITY + i) = NaN + NaN i
cos(±INFINITY ± INFINITY i) = NaN + NaN i

Tangent

Compute the tangent of this complex number.

Implements the formula:

tan(a + bi) = sin(2a)/(cos(2a)+cosh(2b)) + [sinh(2b)/(cos(2a)+cosh(2b))]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 (or critical) values in real or imaginary parts of the input may result in infinite or NaN values returned in parts of the result.

Examples:

tan(a ± INFINITY i) = 0 ± i
tan(±INFINITY + bi) = NaN + NaN i
tan(±INFINITY ± INFINITY i) = NaN + NaN i
tan(±π/2 + 0 i) = ±INFINITY + NaN i

Arcsine

Compute the inverse sine of this complex number.

Implements the formula:

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

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

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.

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.

on
  • T

Methods

acos() Complex
Arccosine
asin() Complex
Arcsine
atan() Complex
Arctangent
cos() Complex
Cosine
sin() Complex
Sine
tan() Complex
Tangent