rotation
[voxscape] / src / lut.h
1 #ifndef LUT_H_
2 #define LUT_H_
3
4 #include <stdint.h>
5
6 #define SINTAB_BITS     9
7 #define SINTAB_SIZE     (1 << SINTAB_BITS)
8
9 #define SIN(angle) \
10         (sintab[((angle) >> (16 - SINTAB_BITS)) & (SINTAB_SIZE - 1)])
11
12 #define COS(angle) \
13         (sintab[(((angle) >> (16 - SINTAB_BITS)) + (SINTAB_SIZE / 4)) & (SINTAB_SIZE - 1)])
14
15
16 extern int32_t sintab[SINTAB_SIZE];
17
18 void init_lut(void);
19
20 #endif  /* LUT_H_ */