From e09a23f0a4f342aa83854ce8cc11aacc09e350fd Mon Sep 17 00:00:00 2001 From: Logan Hunt Date: Mon, 10 Aug 2020 14:04:44 -0600 Subject: Added rotation --- include/sinlut.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 include/sinlut.h (limited to 'include/sinlut.h') diff --git a/include/sinlut.h b/include/sinlut.h new file mode 100644 index 0000000..126679f --- /dev/null +++ b/include/sinlut.h @@ -0,0 +1,15 @@ +#include "types.h" + +#ifndef SINLUT_H +#define SINLUT_H + +extern const short sin_lut[512]; + +static inline s32 lu_sin(u32 theta) +{ return sin_lut[(theta>>7)&0x1FF]; } + +//! Look-up a cosine value +static inline s32 lu_cos(u32 theta) +{ return sin_lut[((theta>>7)+128)&0x1FF]; } + +#endif //SINLUT_H -- cgit v1.3