FastLED 3.9.15
Loading...
Searching...
No Matches

◆ cos16()

LIB8STATIC int16_t cos16 ( uint16_t theta)

Fast 16-bit approximation of cos(x).

This approximation never varies more than 0.69% from the floating point value you'd get by doing

float s = cos(x) * 32767.0;
int x
Definition simple.h:92
Parameters
thetainput angle from 0-65535
Returns
cos of theta, value between -32767 to 32767.
Examples
XYMatrix.ino.

Definition at line 157 of file trig8.h.

157{ return sin16(theta + 16384); }
#define sin16
Platform-independent alias of the fast sin implementation.
Definition trig8.h:112

References LIB8STATIC, and sin16.

Referenced by FL_DISABLE_WARNING(), and loop().

+ Here is the caller graph for this function: