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

◆ cos8()

LIB8STATIC uint8_t cos8 ( uint8_t theta)

Fast 8-bit approximation of cos(x).

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

float s = (cos(x) * 128.0) + 128;
int x
Definition Audio.ino:71
Parameters
thetainput angle from 0-255
Returns
cos of theta, value between 0 and 255

Definition at line 271 of file trig8.h.

271{ return sin8(theta + 64); }
#define sin8
Platform-independent alias of the fast sin implementation.
Definition trig8.h:221

References LIB8STATIC, and sin8.

Referenced by getPaletteIndex().

+ Here is the caller graph for this function: