[gameprogrammer] Re: Diff Between 2 Angles

% or modulus doesn't always work right on negative numbers I think...
 Or for some reason I had problems with it (memory is fuzzy, more
than 2 days old.)  fmod() might not have an issue.  But then I doubt
the loop will be called more than twice although I don't know exactly
what the inputs can look like in the extremes.  Is fmod() (a function
call) faster than the loop and a subtraction?  I don't know.  I was
also maintaining sign of the difference between angles not being sure
if the user wanted it or not.

--- Chris Schnurr <chris.schnurr@xxxxxxxxxx> wrote:
> What about:
> 
> angleDif = (angle1 - angle2) MOD 360 
> 
> if angleDif < 0 then angleDif += 360
> 
> ?? does that work?




        

        
                
__________________________________________________________ 
Find your next car at http://autos.yahoo.ca


---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: