I need a mathematical formula to determine whether given a starting angle and an ending angle, I need to determine whether it is "shorter" to go in a clock-wise direction or anti-clockwise.
starting angle: 50 degrees
ending angle: 60 degrees
It would be clockwise, as it's only 10 degrees in clockwise fashion where as it would 350 degrees if it would to go anti-clockwise to reach the 60 degree mark.
Is there some mathematical formula that can be devised which would return a result indicating a clockwise and anti-clockwise direction? Perhaps something which returns a positive or negative corresponding to each??
For a bit of context I'm a computer programmer and need to implement the logic, but my maths is failing me on this one!