Skip to content

Instantly share code, notes, and snippets.

@alpacato
Created May 23, 2018 14:16
Show Gist options
  • Save alpacato/9fab182247a32ce19a5a3ed51e8d7a0d to your computer and use it in GitHub Desktop.
Save alpacato/9fab182247a32ce19a5a3ed51e8d7a0d to your computer and use it in GitHub Desktop.
0-360
const normalizeAngle = (angle) => {
return angle > 0 ? angle % 360 : 360 - -(angle % 360);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment