rotation
[voxscape] / src / lut.h
diff --git a/src/lut.h b/src/lut.h
new file mode 100644 (file)
index 0000000..4e77b45
--- /dev/null
+++ b/src/lut.h
@@ -0,0 +1,20 @@
+#ifndef LUT_H_
+#define LUT_H_
+
+#include <stdint.h>
+
+#define SINTAB_BITS    9
+#define SINTAB_SIZE    (1 << SINTAB_BITS)
+
+#define SIN(angle) \
+       (sintab[((angle) >> (16 - SINTAB_BITS)) & (SINTAB_SIZE - 1)])
+
+#define COS(angle) \
+       (sintab[(((angle) >> (16 - SINTAB_BITS)) + (SINTAB_SIZE / 4)) & (SINTAB_SIZE - 1)])
+
+
+extern int32_t sintab[SINTAB_SIZE];
+
+void init_lut(void);
+
+#endif /* LUT_H_ */