View Single Post
  #11   Spotlight this post!  
Unread 26-01-2004, 21:08
Ryan Cumings's Avatar
Ryan Cumings Ryan Cumings is offline
Programmer and University Rejected
#0134 (Team Discovery)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2000
Location: Pembroke, NH
Posts: 65
Ryan Cumings is an unknown quantity at this point
Send a message via AIM to Ryan Cumings
Re: Global Constants

I think my trig code will run fine,
It has a lookup table with 1440 16-bit values and my sine and cosine functions take very little hit to performance. The angle I use is also in 16-bit straight from the gyro which makes this whole thing very high precision which will be increadably useful for the new drive style (Arcade) I developed and hopefully will get to test Wednesday.

The reason for so many values is that we have 32k of rom sitting there doing nothing. Infact it would be a much more efficient way to calculate out 8-bit values for your angles and multiply it by a 8-bit number for your hypontenuse then shift right by 8. That essentially does floating point for you without the performance hit. Doing it with 16-bits can be a bit trickier but the same principle applies.