Created
August 6, 2011 02:38
-
-
Save rjungemann/1128943 to your computer and use it in GitHub Desktop.
Normalize an angle in CoffeeScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
normalizeAngle = (a) -> | |
if a < 0 || a > Math.PI * 2 | |
Math.abs Math.PI * 2 - Math.abs(angle) | |
else | |
angle |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment