Nodejs Degree to Radian Convert toRad() // convert degrees to radians

Here you can find the source of toRad() // convert degrees to radians

Method Source Code

Number.prototype.toRad = function() {  // convert degrees to radians
  return this * Math.PI / 180;
}

Related

  1. toRad()
    Number.prototype.toRad = function() {
      return this * Math.PI / 180;
    Number.prototype.toDeg = function() {
      return this * 180 / Math.PI;
    
  2. toRad()
    Number.prototype.toRad = function() {
      return this * Math.PI / 180;
    };
    Number.prototype.toDegree = function() {
      return this / Math.PI * 180;
    };
    
  3. toRad()
    Number.prototype.toRad = function() { 
      return this * Math.PI / 180; 
    };
    Number.prototype.toDeg = function() { 
      return this * 180 / Math.PI; 
    };
    global.getPointAtDistance = function(lat, lon, brng, dist) {
      dist = dist / 6371000;
      brng = brng.toRad();
    ...
    
  4. toRad()
    Number.prototype.toRad = function() {
        return this * Math.PI / 180;
    };
    
  5. toRad()
    Number.prototype.toRad = function() {
      return (this / 180) * Math.PI;
    };
    
  6. toRadians()
    Number.prototype.toRadians = function() {
        return (this / 360) * 2 * Math.PI;
    
  7. toRadians()
    Number.prototype.toRadians = function() { 
      return this * Math.PI / 180; 
    
  8. toRadians()
    function getHaversineDistance(point1, point2){  
      var R = 6372.8;
      var dLat = (point2.lat - point1.lat).toRadians();
        var dLon = (point2.lon - point1.lon).toRadians();
        var lat1 = point1.lat.toRadians();
        var lat2 = point2.lat.toRadians();
      var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.sin(dLon/2) * Math.sin(dLon/2) * Math.cos(lat1) * Math.cos(lat2)
      var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a))
      return = R * c;   
    ...
    
  9. toRadians()
    'use strict'
    Number.prototype.toRadians = function() {
      return this * Math.PI / 180;