I suppose I should have specified, mine returns the results in feet.
I'm using it for relatively small distances.

Chad Killingsworth

On Feb 25, 8:11 am, Esa <[email protected]> wrote:
> Quickly tried and I got very different results compared to mine:
>
> /**
>  * distance from this LatLng to a given LatLng
>  */
> google.maps.LatLng.prototype.kmTo = function(a){
>   var e = Math, ra = e.PI/180;
>   var b = this.lat() * ra, c = a.lat() * ra, d = b - c;
>   var g = this.lng() * ra - a.lng() * ra;
>   var f = 2 * e.asin(e.sqrt(e.pow(e.sin(d/2), 2) + e.cos(b) * e.cos(c)
> * e.pow(e.sin(g/2), 2)));
>   return f * 6378.137;

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to