What is the argument to all of the wave functions like sin8? I know the type but does the type represent radians, degrees or ?
It would be nice if the documentation for these functions specified this
What is the argument to all of the wave functions like sin8? I know the type but does the type represent radians, degrees or ?
It would be nice if the documentation for these functions specified this
From lib8tion.h:
Fast 16-bit approximations of sin and cos.
Input angle is a uint16_t from 0-65535.
Output is a signed int16_t from -32767 to 32767.
sin16( x) == sin( (x/32768.0) * pi) * 32767
cos16( x) == cos( (x/32768.0) * pi) * 32767
Accurate to more than 99% in all cases.
Fast 8-bit approximations of sin and cos.
Input angle is a uint8_t from 0-255.
Output is an UNsigned uint8_t from 0 to 255.
sin8( x) == (sin( (x/128.0) * pi) * 128) + 128
cos8( x) == (cos( (x/128.0) * pi) * 128) + 128
Accurate to within about 2%.
and from https://github.com/FastLED/FastLED/wiki/High-performance-math
The library also has fast 16bit sin/cos functions. The input is an “angle” from 0-65535, and the output is a singed 16 bit number from -32767 to 32767:
(and I just updated the wiki page to add the 8bit function documentation - and working on doxygen documentation for people who don’t want to header file or wiki dive, though they’d still need to go through that documentation 
So it looks like the angle is in degrees ? Correct ?
Well, not exactly. sin8 uses 255 to mean 360 degrees. sin16 uses 65535 to mean 360 degrees. Neither use degrees or radians, They assume the maximum value of the integer type they accept is one full revolution around.
“Binary degrees”
For sin8 and cos8, one circle = 256.
For sin16 and cos18, one circle = 65,536.
Got it,
Thanks
Those Babylonians would have saved us so many problems if they just would’ve used 256 instead of 360 divisions in a circle.