Real trig functions

Floating point sine, cosine, tangent about θ = 0

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

Tip

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

boring_math.special_functions.trigonometry.trig0.sin0(θ: float, /, n: int = epth)) float

Sine centered at x = 0.

Partially factored Taylor series expansion of sine centered at x = 0.

Tip

Best n to use

  • n >= 20 when -2π <= θ <=

  • n >= 15 when <= θ <= π

  • n >= 12 when -π/2 <= θ <= π/2

The default is n=20.

Parameters:
  • θ – angle in radians

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

Returns:

Taylor series expansion of sine(θ) centered at θ = 0

boring_math.special_functions.trigonometry.trig0.cos0(θ: float, /, n: int = epth)) float

Cosine centered at x = 0.

Partially factored Taylor series expansion of cosine centered at x = 0.

Tip

Best n to use

  • n >= 20 when -2π <= θ <=

  • n >= 15 when <= θ <= π

  • n >= 12 when -π/2 <= θ <= π/2

The default is n=20.

Parameters:
  • θ – angle in radians

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

Returns:

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

boring_math.special_functions.trigonometry.trig0.tan0(θ: float, /, n: int = epth)) float

Tangent centered at θ = 0.

Partially factored Taylor series expansion of tangent centered at θ = 0.

Tip

Best n to use

  • n >= 20 when -2π <= θ <=

  • n >= 15 when <= θ <= π

  • n >= 12 when -π/2 <= θ <= π/2

The default is n=20.

Parameters:
  • θ – angle in radians

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

Returns:

sin0(θ)/cos0(θ)

Floating point trigonometric functions.

Valid for all extended real value θ.

boring_math.special_functions.trigonometry.trig.sin(θ: float) float

Sine centered at θ = 0.

Sine for all real θ.

Parameters:

θ – Angle in radians.

Returns:

Sine of angle θ.

boring_math.special_functions.trigonometry.trig.cos(θ: float) float

Cosine centered at θ = 0.

Cosine for all real θ.

Parameters:

θ – Angle in radians.

Returns:

Cosine of angle θ.

boring_math.special_functions.trigonometry.trig.tan(θ: float) float

Tangent centered at θ = 0.

Tangent for all real θ.

Parameters:

θ – Angle in radians.

Returns:

Tangent of angle θ.