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

Definition at line 266 of file trig8.h.

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

References LIB8STATIC, and sin8.

Referenced by getPaletteIndex().

+ Here is the caller graph for this function: