![]() |
Klang C++ 0.7.15
Language Reference (draft)
|
Functions | |
| float | sin (float x) |
| Approximate sine of a finite angle in radians. | |
| float | cos (float x) |
| Approximate cosine of a finite angle in radians. | |
| float | sinp (unsigned int phase) |
| Approximate sine from an unsigned 32-bit phase covering one turn. | |
| float | cosp (unsigned int phase) |
| Approximate cosine from an unsigned 32-bit phase covering one turn. | |
Variables | |
| constexpr float | twoPi = float(2.0 * 3.1415926535897932384626433832795) |
Fast scalar approximations. Angles use radians unless a p suffix identifies an unsigned 32-bit phase covering one complete turn. Sine uses the retained V2/Farbrausch range reduction and Robin Green odd polynomial. Cosine reuses that polynomial with direct quadrant reduction, avoiding an added pi/2 before the existing modulo step.
|
inline |
Definition at line 6320 of file klang.h.
References cos(), klang::fast_mod2pi(), and klang::pi.
Referenced by cos().
|
inline |
|
inline |
Definition at line 6310 of file klang.h.
References klang::fast_mod2pi(), klang::pi, and twoPi.
|
inline |
Definition at line 6327 of file klang.h.
References klang::fast_modp(), klang::pi, sinp(), and twoPi.
Referenced by klang::Generators::Fast::Sine::process(), and sinp().