Created
May 17, 2014 23:38
-
-
Save tsbits/1a391f1fc35a5a1210a8 to your computer and use it in GitHub Desktop.
Degree to radian and vice-versa
This file contains 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
//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