fix geodesic circle - formula had errors!

https://plus.google.com/108582664457219405296/posts/CoNTvk5i4xF
This commit is contained in:
Jon Atkins 2013-10-20 22:55:55 +01:00
parent 60e6552ca2
commit 5b81fa4086

View File

@ -174,10 +174,9 @@ Modified by qnstie 2013-07-17 to maintain compatibility with Leaflet.draw
var calcLatLngAtAngle = function(angle) { var calcLatLngAtAngle = function(angle) {
var lat = Math.asin(sinCentreLat*cosRadRadius + cosCentreLat*sinRadRadius*Math.cos(angle)); var lat = Math.asin(sinCentreLat*cosRadRadius + cosCentreLat*sinRadRadius*Math.cos(angle));
var lng = centreLng + Math.atan2(Math.sin(angle)*sinRadRadius*cosCentreLat, cosRadRadius-sinCentreLat*Math.sin(lat));
var lon = centreLng + Math.asin( Math.sin(angle) * sinRadRadius / cosCentreLat ) return L.latLng(lat * r2d,lng * r2d);
return L.latLng(lat * r2d,lon * r2d);
} }