Quote:
|
Originally Posted by jweric
So I was wondering if anyone has a header file that can perform trigonometric functions in the programing.
The reason why I need it is for our teams drive system.
|
There is another way.
You can generate lookup tables. Store these in arrays. Then a sin() function, for example, would simply look up the closest value of sin. There is almost no where you would need (and could practically use) more accurate values for trig functions. If I have time, I'll write some code to do that for sine. Check this site:
http://nrg.chaosnet.org/uploads/resources for updates.
P.S: Cosine and tangent can be calculated for sine because cos(angle)=sin(angle+90 degrees) and tan=sin(angle)/sin(angle+90 degrees).