Created
September 21, 2012 09:07
-
-
Save hendriklammers/3760498 to your computer and use it in GitHub Desktop.
Javascript: Calculate Radians/Degrees
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
// Returns radians from the given value in degrees | |
function degreesToRadians(degrees) { | |
return degrees * (Math.PI / 180); | |
} | |
// Returns degrees from the given value in radians | |
function radiansToDegrees(radians) { | |
return radians * (180 / Math.PI); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment