Skip to content

Instantly share code, notes, and snippets.

@rjungemann
Created August 6, 2011 02:38
Show Gist options
  • Save rjungemann/1128943 to your computer and use it in GitHub Desktop.
Save rjungemann/1128943 to your computer and use it in GitHub Desktop.
Normalize an angle in CoffeeScript
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