I noticed you have a cosine and sine lookup table header. If you are implementing lookup based functions for these, may I suggest storing just the sine range equivalent to 0-90 degrees (the first quarter) and making use of the fact that the curve is symmetrical. The same table can be used to compute sine and cosine and will be much smaller and more cache friendly.