Created
March 20, 2015 20:18
-
-
Save westc/104938a64d50c3c8635a to your computer and use it in GitHub Desktop.
Versions of Math.cos, Math.sin, and Math.tan that accept values in degrees instead of radians.
This file contains hidden or 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
(function (R) { | |
Math.cosd = function(d) { return Math.cos(d * R); }; | |
Math.sind = function(d) { return Math.sin(d * R); }; | |
Math.tand = function(d) { return Math.tan(d * R); }; | |
})(Math.PI / 180); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment