|
Re: Programming Trigonometric Functions
What accuracy (how many decimal places) do you really need? For example, take an angles of 1.0, 1.1, 1.01, 1.001, etc and use those to calculate distances in the size of the playing field. What accuracy is good enough?
I forget which college math class it is but they teach how to stop the series based on how many decimal places of accuracy you want. Also consider how many bits is the variable you are using and what accuracy actually fits inside of that. Once these things are considered 20 decimals places for pi does not add to the accuracy.
If you choose to use the math library instead, those almost always have the accuracy and overflow issues sorted out.
__________________
Keith Watson - Professional Software Engineer
No relation to "Kevin" Watson, who created the camera tracking code.
|