|
Re: how to calculate distance from pairs of latitude/longitude measurements? [message #65597 is a reply to message #65596] |
Wed, 11 March 2009 18:23  |
Greg Hennessy
Messages: 45 Registered: November 2005
|
Member |
|
|
On 2009-03-11, llo <bernat.puigdomenech@gmail.com> wrote:
> d=acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon1-lon2 ))
>
> A mathematically equivalent formula, which is less subject to rounding
> error for short distances is:
>
> d=2*asin(sqrt((sin((lat1-lat2)/2))^2 + cos(lat1)*cos(lat2)*(sin((lon1-
> lon2)/2))^2))
>
> the result is 0.8777. 0.8777 distance from montreal to albany ????
Strange, the answer to your calculation is in radians, so needs to be
multiplied by the radius of the earth, but that number doesn't seem
correct either.
|
|
|