Complex trig functions

Real valued sine, cosine, tangent about z = 0

The named only argument n must be at least 20 to totally agree with stdlib cmath for 0 |z| < 1.

Tip

For small |z| you can get away with smaller n values to reduce the number of computations.

boring_math.special_functions.trigonometry.ctrig0.csin0(z: complex, /, n: int = depth) complex

Partially factored Taylor expansion of sine about z = 0.

Tip

Best if

  • |z| 1 and n 20.

  • |z| π and n 22.

Parameters:
  • z – independent variable

  • n – terms in expansion, must have 2 n 84

Returns:

Taylor series expansion of sine(x) centered at z = 0.

boring_math.special_functions.trigonometry.ctrig0.ccos0(z: complex, /, n: int = depth) complex

Partially factored Taylor expansion of cosine about z = 0.

Tip

Best if

  • |z| 1 and n 20.

  • |z| π and n 22.

Parameters:
  • z – independent variable

  • n – terms in expansion, must have 2 n 84

Returns:

Taylor series expansion of cosine(z) centered at z = 0

boring_math.special_functions.trigonometry.ctrig0.ctan0(z: complex, /, n: int = depth) complex

Tangent centered about z = 0.

Tip

Best if

  • |z| 1 and n 20.

  • |z| π and n 22.

Parameters:
  • z – Independent variable.

  • n – Terms in expansion, must have 2 n 84.

Returns:

The value csin0(z)/ccos0(z).

Complex valued sine, cosine, tangent

The named only argument n must be at least 22 to agree with the ones from stdlib cmath.

Tip

For 0 |z| < 1 you can get away with smaller n values to reduce the number of computations.

boring_math.special_functions.trigonometry.ctrig.csin(z: complex, /, n: int = depth) complex

Complex tangent

Complex sine valid for all z∈ℂ.

Parameters:
  • z – Independent variable.

  • n – Terms in expansion, must have 2 n 84.

Returns:

Value of sine(z).

boring_math.special_functions.trigonometry.ctrig.ccos(z: complex, /, n: int = depth) complex

Complex cosine

Complex cosine valid for all z∈ℂ.

Parameters:
  • z – Independent variable.

  • n – Terms in expansion, must have 2 n 84.

Returns:

Value of cosine(z).

boring_math.special_functions.trigonometry.ctrig.ctan(z: complex, /, n: int = depth) complex

Complex tangent

Complex tangent valid for all z∈ℂ.

Parameters:
  • z – Independent variable.

  • n – Terms in expansion, must have 2 n 84.

Returns:

Value of tangent(z) via sine(z)/cosine(z).