Find the shortest rotation angle between two angles
2 June 2009 No Comment
That’s it, the following code finds for you the shortest rotation angle from a given angle to another:
var diffAngle:Number = Math.atan2(Math.sin(angleTo - currentAngle), Math.cos(angleTo - currentAngle));
The code was given on this forum. You’ll also find a way to do it with vectors.