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;
uint32_t x[NUM_LAYERS]
Definition Fire2023.ino:80
Parameters
thetainput angle from 0-65535
Returns
cos of theta, value between -32767 to 32767.
Examples
XYMatrix.ino.

Definition at line 143 of file trig8.h.

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

References LIB8STATIC, and sin16.

Referenced by loop().

+ Here is the caller graph for this function: