#ifndef _AS_GA_TRIG #define _AS_GA_TRIG // As macros, they don't need to know what Costable and degreecount // are. But they need to be in hpp for others to access. // Then, those that access, need to know what CosTable is. // Only takes positive angles #define COS(a) ( CosTable [a & (AS_DEGREES_360 - 1)] ) #define SIN(a) ( SinTable [a & (AS_DEGREES_360 - 1)] ) #define PI 3.141592654 //const unsigned int DEGREECOUNT = 1024; const unsigned int AS_DEGREES_360 = 4096; const unsigned int AS_DEGREES_180 = (unsigned int)(AS_DEGREES_360 / 2.0); const unsigned int AS_DEGREES_90 = (unsigned int)(AS_DEGREES_360 / 4.0); const unsigned int AS_DEGREES_45 = (unsigned int)(AS_DEGREES_360 / 8.0); const unsigned int AS_DEGREES_270 = AS_DEGREES_180 + AS_DEGREES_90; extern float SinTable [ AS_DEGREES_360 ]; extern float CosTable [ AS_DEGREES_360 ]; #endif