Calculate the angular separation with sign (direction)
Returns the signed angle from angle1 to angle2, moving in the positive direction (counter-clockwise). Result is in range (-180, +180].
Positive = angle2 is ahead (counter-clockwise) Negative = angle2 is behind (clockwise)
Starting angle in degrees
Ending angle in degrees
Signed angular separation in degrees (-180, +180]
signedAngularSeparation(10, 50) // +40 (50 is ahead)signedAngularSeparation(50, 10) // -40 (10 is behind)signedAngularSeparation(350, 10) // +20 (crossing 0°)signedAngularSeparation(10, 350) // -20 (crossing 0° backwards) Copy
signedAngularSeparation(10, 50) // +40 (50 is ahead)signedAngularSeparation(50, 10) // -40 (10 is behind)signedAngularSeparation(350, 10) // +20 (crossing 0°)signedAngularSeparation(10, 350) // -20 (crossing 0° backwards)
Calculate the angular separation with sign (direction)
Returns the signed angle from angle1 to angle2, moving in the positive direction (counter-clockwise). Result is in range (-180, +180].
Positive = angle2 is ahead (counter-clockwise) Negative = angle2 is behind (clockwise)