Versions of Math.cos, Math.sin, and Math.tan that accept values in degrees instead of radians.
(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);