I've been spending an embarrassing amount of time on a fairly simple problem. In my 2D world each entity has an orientation (theta) which represents the direction it is facing.
Given its current orientation and a target orientation, I want to find out:
The change in theta required to achieve the target orientation, rotating clockwise.
The change in theta required to acheive the target orientation, rotating counter clockwise.
the closest I got was abs(current - target) for clockwise rotations, and -abs(current - target), for counter clockwise rotations. But that falls apart when you go past 0.
This should be simple, but i can't seem to work it out.
Please help






