LispBM
Loading...
Searching...
No Matches
lbm_cos_table.h
Go to the documentation of this file.
1/*
2 Copyright 2025 Joel Svensson svenssonjoel@yahoo.se
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#ifndef LBM_COS_TABLE_H_
19#define LBM_COS_TABLE_H_
20
21#include <stdint.h>
22
23// Cosine lookup table for a single quadrant (0° to 90°)
24// 128 entries, values scaled 0-255 (representing 0.0 to 1.0)
25// Can be used for both cosine and sine with appropriate indexing
26static const uint8_t lbm_cos_tab_128[] =
27 {
28 255, 255, 255, 255, 254, 254, 254, 253, 253, 252, // 0 - 9
29 251, 250, 250, 249, 248, 246, 245, 244, 243, 241, //10 - 19
30 240, 238, 237, 235, 234, 232, 230, 228, 226, 224, //20 - 29
31 222, 220, 218, 215, 213, 211, 208, 206, 203, 201, //30 - 39
32 198, 196, 193, 190, 188, 185, 182, 179, 176, 173, //40 - 49
33 170, 167, 165, 162, 158, 155, 152, 149, 146, 143, //50 - 59
34 140, 137, 134, 131, 127, 124, 121, 118, 115, 112, //60 - 69
35 109, 106, 103, 100, 97, 93, 90, 88, 85, 82, //70 - 79
36 79, 76, 73, 70, 67, 65, 62, 59, 57, 54, //80 - 89
37 52, 49, 47, 44, 42, 40, 37, 35, 33, 31, //90 - 99
38 29, 27, 25, 23, 21, 20, 18, 17, 15, 14, //100 - 109
39 12, 11, 10, 9, 7, 6, 5, 5, 4, 3, //110 - 119
40 2, 2, 1, 1, 1, 0, 0, 0 //120 - 127
41};
42
43#endif
static const uint8_t lbm_cos_tab_128[]
Definition lbm_cos_table.h:26