Remove unused sphere.equirectangularDistance() method
This commit is contained in:
@@ -70,24 +70,6 @@ ol.Sphere.prototype.geodesicArea = function(coordinates) {
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns the distance from c1 to c2 using Pythagoras's theorem on an
|
||||
* equirectangular projection.
|
||||
*
|
||||
* @param {ol.Coordinate} c1 Coordinate 1.
|
||||
* @param {ol.Coordinate} c2 Coordinate 2.
|
||||
* @return {number} Equirectangular distance.
|
||||
*/
|
||||
ol.Sphere.prototype.equirectangularDistance = function(c1, c2) {
|
||||
var lat1 = goog.math.toRadians(c1[1]);
|
||||
var lat2 = goog.math.toRadians(c2[1]);
|
||||
var deltaLon = goog.math.toRadians(c2[0] - c1[0]);
|
||||
var x = deltaLon * Math.cos((lat1 + lat2) / 2);
|
||||
var y = lat2 - lat1;
|
||||
return this.radius * Math.sqrt(x * x + y * y);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Returns the distance from c1 to c2 using the haversine formula.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user