Nodejs Degree to Radian Convert toRadians(degrees)

Here you can find the source of toRadians(degrees)

Method Source Code

Math.toRadians = function(degrees){
  if (degrees < 0) {
    degrees += 360;//from   w  w  w.  j av  a  2  s.  c o m
  }
  return degrees / 180 * Math.PI;
};

Related

  1. deg2Rad(deg)
    Math.deg2Rad = function(deg)
      return (deg / 180) * Math.PI;
    
  2. degToRad(angle)
    function degToRad(angle) {
      return ((angle * Math.PI) / 180);
    
  3. degToRad(deg)
    function degToRad(deg) {
      return deg * Math.PI / 180;
    
  4. degrees(radians)
    Math.degrees = function(radians){
      return radians * 180 / Math.PI;
    };
    
  5. radians(degrees)
    Math.radians = function(degrees){
      return degrees * Math.PI / 180;
    };
    
  6. degToRad(degrees)
    Math.degToRad = function(degrees){
      return degrees * Math.PI / 180;
    };
    
  7. toRad()
    Number.prototype.toRad = function() {
      return this * Math.PI / 180;