Skip to content

Instantly share code, notes, and snippets.

@tsbits
Created May 17, 2014 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsbits/1a391f1fc35a5a1210a8 to your computer and use it in GitHub Desktop.
Save tsbits/1a391f1fc35a5a1210a8 to your computer and use it in GitHub Desktop.
Degree to radian and vice-versa
//From http://cwestblog.com/2012/11/12/javascript-degree-and-radian-conversion/
// Converts from degrees to radians.
Math.radians = function(degrees) {
return degrees * Math.PI / 180;
};
// Converts from radians to degrees.
Math.degrees = function(radians) {
return radians * 180 / Math.PI;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment