Here you can find the source of rad2Deg(rad)
/**/*ww w . j a v a 2s . c o m*/ * Converts the specified angle in radians to degrees. * @param {Number} rad */ Math.rad2Deg = function(rad) { return (rad / Math.PI) * 180; }
function radToDeg(angle) { return ((angle * 180) / Math.PI);
function radToDeg(rad) { return rad / Math.PI * 180;
Math.toDegrees = function(radians) { return radians * 180 / Math.PI; };
Number.prototype.toDeg = function() { return this * 180 / Math.PI; Number.prototype.toRad = function() { return this * Math.PI / 180;