-
Notifications
You must be signed in to change notification settings - Fork 2
/
math_tables.c
67 lines (59 loc) · 3.1 KB
/
math_tables.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include "blast.h"
const s8 sin_table[256] = {
0,2,3,5,6,8,9,11,12,14,16,17,19,20,22,23,
24,26,27,29,30,32,33,34,36,37,38,39,41,42,43,44,
45,46,47,48,49,50,51,52,53,54,55,56,56,57,58,59,
59,60,60,61,61,62,62,62,63,63,63,64,64,64,64,64,
64,64,64,64,64,64,63,63,63,62,62,62,61,61,60,60,
59,59,58,57,56,56,55,54,53,52,51,50,49,48,47,46,
45,44,43,42,41,39,38,37,36,34,33,32,30,29,27,26,
24,23,22,20,19,17,16,14,12,11,9,8,6,5,3,2,
0,-2,-3,-5,-6,-8,-9,-11,-12,-14,-16,-17,-19,-20,-22,-23,
-24,-26,-27,-29,-30,-32,-33,-34,-36,-37,-38,-39,-41,-42,-43,-44,
-45,-46,-47,-48,-49,-50,-51,-52,-53,-54,-55,-56,-56,-57,-58,-59,
-59,-60,-60,-61,-61,-62,-62,-62,-63,-63,-63,-64,-64,-64,-64,-64,
-64,-64,-64,-64,-64,-64,-63,-63,-63,-62,-62,-62,-61,-61,-60,-60,
-59,-59,-58,-57,-56,-56,-55,-54,-53,-52,-51,-50,-49,-48,-47,-46,
-45,-44,-43,-42,-41,-39,-38,-37,-36,-34,-33,-32,-30,-29,-27,-26,
-24,-23,-22,-20,-19,-17,-16,-14,-12,-11,-9,-8,-6,-5,-3,-2,
};
const s8 cos_table[256] = {
64,64,64,64,64,64,63,63,63,62,62,62,61,61,60,60,
59,59,58,57,56,56,55,54,53,52,51,50,49,48,47,46,
45,44,43,42,41,39,38,37,36,34,33,32,30,29,27,26,
24,23,22,20,19,17,16,14,12,11,9,8,6,5,3,2,
0,-2,-3,-5,-6,-8,-9,-11,-12,-14,-16,-17,-19,-20,-22,-23,
-24,-26,-27,-29,-30,-32,-33,-34,-36,-37,-38,-39,-41,-42,-43,-44,
-45,-46,-47,-48,-49,-50,-51,-52,-53,-54,-55,-56,-56,-57,-58,-59,
-59,-60,-60,-61,-61,-62,-62,-62,-63,-63,-63,-64,-64,-64,-64,-64,
-64,-64,-64,-64,-64,-64,-63,-63,-63,-62,-62,-62,-61,-61,-60,-60,
-59,-59,-58,-57,-56,-56,-55,-54,-53,-52,-51,-50,-49,-48,-47,-46,
-45,-44,-43,-42,-41,-39,-38,-37,-36,-34,-33,-32,-30,-29,-27,-26,
-24,-23,-22,-20,-19,-17,-16,-14,-12,-11,-9,-8,-6,-5,-3,-2,
0,2,3,5,6,8,9,11,12,14,16,17,19,20,22,23,
24,26,27,29,30,32,33,34,36,37,38,39,41,42,43,44,
45,46,47,48,49,50,51,52,53,54,55,56,56,57,58,59,
59,60,60,61,61,62,62,62,63,63,63,64,64,64,64,64,
};
const u8 atan_table[17] = {
0,2,5,7,9,12,14,16,18,20,22,24,26,27,29,30,
32,
};
const u8 sqrt_table[256] = {
0,16,23,28,32,36,39,42,45,48,51,53,55,58,60,62,
64,66,68,70,72,73,75,77,78,80,82,83,85,86,88,89,
91,92,93,95,96,97,99,100,101,102,104,105,106,107,109,110,
111,112,113,114,115,116,118,119,120,121,122,123,124,125,126,127,
128,129,130,131,132,133,134,135,136,137,138,139,139,140,141,142,
143,144,145,146,147,148,148,149,150,151,152,153,153,154,155,156,
157,158,158,159,160,161,162,162,163,164,165,166,166,167,168,169,
169,170,171,172,172,173,174,175,175,176,177,177,178,179,180,180,
181,182,182,183,184,185,185,186,187,187,188,189,189,190,191,191,
192,193,193,194,195,195,196,197,197,198,199,199,200,200,201,202,
202,203,204,204,205,206,206,207,207,208,209,209,210,210,211,212,
212,213,213,214,215,215,216,216,217,218,218,219,219,220,221,221,
222,222,223,223,224,225,225,226,226,227,227,228,229,229,230,230,
231,231,232,232,233,234,234,235,235,236,236,237,237,238,238,239,
239,240,241,241,242,242,243,243,244,244,245,245,246,246,247,247,
248,248,249,249,250,250,251,251,252,252,253,253,254,254,255,255,
};