FastLED 3.9.15
Loading...
Searching...
No Matches
sin32.cpp.hpp
Go to the documentation of this file.
1
2
3#include "fl/stl/int.h"
4#include "fl/math/sin32.h"
5#include "fastled_progmem.h"
6
7namespace fl {
8
9// Paired sin/cos quarter-wave LUT with interleaved values and derivatives.
10// Layout per entry [qi]: { y_sin(qi), m_sin(qi), y_cos(qi), m_cos(qi) }
11// where y_cos(qi) = y_sin(64-qi) and m_cos(qi) = m_sin(64-qi).
12// This means accessing sinCosPairedLut[qi*4] gives both sin AND cos values
13// in the same cache line (16 bytes per entry, 4 entries per 64B line).
14// 65 entries x 4 i32 = 260 i32 = 1040 bytes.
15//
16// Generated by ci/generate_sin_lut.py
18 // [qi] y_sin, m_sin, y_cos(=y_sin[64-qi]), m_cos(=m_sin[64-qi])
19 0, 52705570, 2147418112, 0, // [ 0]
20 52700279, 52689696, 2146771350, 1293459, // [ 1]
21 105368813, 52642084, 2144831453, 2586140, // [ 2]
22 157973876, 52562762, 2141599590, 3877262, // [ 3]
23 210483782, 52451778, 2137077707, 5166049, // [ 4]
24 262866901, 52309200, 2131268528, 6451724, // [ 5]
25 315091678, 52135112, 2124175553, 7733513, // [ 6]
26 367126656, 51929620, 2115803055, 9010644, // [ 7]
27 418940491, 51692847, 2106156075, 10282347, // [ 8]
28 470501971, 51424937, 2095240426, 11547856, // [ 9]
29 521780039, 51126050, 2083062682, 12806409, // [10]
30 572743806, 50796367, 2069630180, 14057248, // [11]
31 623362574, 50436086, 2054951009, 15299619, // [12]
32 673605851, 50045424, 2039034013, 16532775, // [13]
33 723443373, 49624617, 2021888779, 17755972, // [14]
34 772845120, 49173917, 2003525635, 18968473, // [15]
35 821781334, 48693597, 1983955641, 20169548, // [16]
36 870222537, 48183946, 1963190588, 21358474, // [17]
37 918139552, 47645271, 1941242981, 22534535, // [18]
38 965503513, 47077896, 1918126042, 23697021, // [19]
39 1012285891, 46482163, 1893853696, 24845234, // [20]
40 1058458505, 45858431, 1868440564, 25978480, // [21]
41 1103993544, 45207075, 1841901952, 27096078, // [22]
42 1148863579, 44528489, 1814253848, 28197355, // [23]
43 1193041581, 43823080, 1785512905, 29281646, // [24]
44 1236500939, 43091274, 1755696436, 30348299, // [25]
45 1279215476, 42333511, 1724822401, 31396671, // [26]
46 1321159461, 41550248, 1692909397, 32426132, // [27]
47 1362307629, 40741957, 1659976648, 33436060, // [28]
48 1402635193, 39909124, 1626043992, 34425847, // [29]
49 1442117863, 39052251, 1591131867, 35394898, // [30]
50 1480731855, 38171855, 1555261303, 36342627, // [31]
51 1518453909, 37268466, 1518453909, 37268466, // [32] (sin==cos at 45 deg)
52 1555261303, 36342627, 1480731855, 38171855, // [33]
53 1591131867, 35394898, 1442117863, 39052251, // [34]
54 1626043992, 34425847, 1402635193, 39909124, // [35]
55 1659976648, 33436060, 1362307629, 40741957, // [36]
56 1692909397, 32426132, 1321159461, 41550248, // [37]
57 1724822401, 31396671, 1279215476, 42333511, // [38]
58 1755696436, 30348299, 1236500939, 43091274, // [39]
59 1785512905, 29281646, 1193041581, 43823080, // [40]
60 1814253848, 28197355, 1148863579, 44528489, // [41]
61 1841901952, 27096078, 1103993544, 45207075, // [42]
62 1868440564, 25978480, 1058458505, 45858431, // [43]
63 1893853696, 24845234, 1012285891, 46482163, // [44]
64 1918126042, 23697021, 965503513, 47077896, // [45]
65 1941242981, 22534535, 918139552, 47645271, // [46]
66 1963190588, 21358474, 870222537, 48183946, // [47]
67 1983955641, 20169548, 821781334, 48693597, // [48]
68 2003525635, 18968473, 772845120, 49173917, // [49]
69 2021888779, 17755972, 723443373, 49624617, // [50]
70 2039034013, 16532775, 673605851, 50045424, // [51]
71 2054951009, 15299619, 623362574, 50436086, // [52]
72 2069630180, 14057248, 572743806, 50796367, // [53]
73 2083062682, 12806409, 521780039, 51126050, // [54]
74 2095240426, 11547856, 470501971, 51424937, // [55]
75 2106156075, 10282347, 418940491, 51692847, // [56]
76 2115803055, 9010644, 367126656, 51929620, // [57]
77 2124175553, 7733513, 315091678, 52135112, // [58]
78 2131268528, 6451724, 262866901, 52309200, // [59]
79 2137077707, 5166049, 210483782, 52451778, // [60]
80 2141599590, 3877262, 157973876, 52562762, // [61]
81 2144831453, 2586140, 105368813, 52642084, // [62]
82 2146771350, 1293459, 52700279, 52689696, // [63]
83 2147418112, 0, 0, 52705570, // [64]
84};
85
86} // namespace fl
#define FL_ALIGN_PROGMEM(N)
Force N-byte alignment for platforms with unaligned access or cache-line optimization.
#define FL_PROGMEM
PROGMEM keyword for storage.
Wrapper definitions to allow seamless use of PROGMEM in environments that have it.
const i32 sinCosPairedLut[]
Base definition for an LED controller.
Definition crgb.hpp:179