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 Audio.ino:71
Parameters
thetainput angle from 0-65535
Returns
cos of theta, value between -32767 to 32767.
Examples
XYMatrix.ino.

Definition at line 148 of file trig8.h.

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

References LIB8STATIC, and sin16.

Referenced by loop(), and fl::Transform16::transform().

+ Here is the caller graph for this function: