Skip to main content

Module sin_cos

Module sin_cos 

Source
Expand description

Implementations of SinCos and SinCosAssign, traits for computing the sine and cosine of Floats together.

Functionsยง

primitive_float_sin_cos
Computes $\sin x$ and $\cos x$, the sine and cosine of a primitive float, together. Using this function is more accurate than using the default sin_cos function or the ones provided by libm.
primitive_float_sin_cos_pi
Computes $\sin(\pi x)$ and $\cos(\pi x)$, the sine and cosine of a primitive float measured in half-turns, together.
primitive_float_sin_cos_pi_rational
Computes $\sin(\pi x)$ and $\cos(\pi x)$, the sine and cosine of a Rational measured in half-turns, together, returning the results as primitive floats.
primitive_float_sin_cos_rational
Computes $\sin x$ and $\cos x$, the sine and cosine of a Rational, together, returning the results as primitive floats.
primitive_float_sin_cos_with_period
Computes $\sin(2\pi x/u)$ and $\cos(2\pi x/u)$, the sine and cosine of a primitive float measured in $u$ths of a turn (so that u = 360 is degrees), together.
primitive_float_sin_cos_with_period_rational
Computes $\sin(2\pi x/u)$ and $\cos(2\pi x/u)$, the sine and cosine of a Rational measured in $u$ths of a turn (so that u = 360 is degrees), together, returning the results as primitive floats.