So I have two angles, a1 and a2, in the range [0, 2*PI). I want to adjust a1 .01 radians towards a2. How do I determine if I need to add or subtract .01 radians?
I understand that I can calculate the two differences thusly:
difference1 = Math.abs(a2 - a1)
difference2 = 2*PI - difference1
But even given those two differences, I don't see how to make the leap in the right direction. I can't think of a simple way of doing it that doesn't involve looking at things on a case by case, per quadrant basis.
↧