View Single Post
  #10   Spotlight this post!  
Unread 01-21-2004, 07:54 PM
Guest
 
Posts: n/a
Re: Needing A header file

Quote:
Originally Posted by jweric
Their is a problem with that. If I cant do an Inverse trig function, I cannot find the angle.
...
But the formula I would be using for one of the pwms is:

PWM = p1_y - sin(1.4172 * p1_x - 127)
You can use the approach I described above for inverse sine and sine.

Anyway, why are you using floating point? Are you sure you want to do that? It slows the processor down, and if you'll be using "true" trig functions, you'll slow it down even more. (That's another point where lookup tables help. They're moderately fast, b/c pointer arithmatic is much faster than floating-point calculation). I'd suggest sticking with an integer value (maybe in degrees) for the argument to sin().