Skip to content

Instantly share code, notes, and snippets.

@technikhil314
Created August 6, 2021 13:02
Show Gist options
  • Select an option

  • Save technikhil314/7430ef01f3f27485b700dc20dbc5e2da to your computer and use it in GitHub Desktop.

Select an option

Save technikhil314/7430ef01f3f27485b700dc20dbc5e2da to your computer and use it in GitHub Desktop.
Return only positive angle degrees
function positiveDeg(input) {
const actualInput = input % 360;
return actualInput >= 0 ? actualInput : 360 + actualInput;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment