[gameprogrammer] Re: Diff Between 2 Angles

  • From: Matthew Weigel <unique@xxxxxxxxxxx>
  • To: gameprogrammer@xxxxxxxxxxxxx
  • Date: Sat, 01 Oct 2005 10:27:00 -0500

Stephen wrote:

I do believe that works*!! Thanks a lot. Its caused me real headaches, and always when I think I've solved it, it doesn't work with two particular angles.

(* The author retains the right to retract that statement should he come across two angles that it doesn't work with).

Thanks again.

> Olof Bjarnason wrote: > >> double absanglediff(double angle1, double angle2) { ... >> return abs(angle1); >> }

Along the same lines as my last comment, I forgot to point out that you should probably use fabs() instead of abs() since you are taking doubles as arguments and returning double. Alternatively, if all you want are whole angles, switch to int for the arguments and return type.

--
 Matthew Weigel
 hacker
 unique@xxxxxxxxxxx


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


Other related posts: