comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: how to calculate distance from pairs of latitude/longitude measurements?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
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 Go to previous message
Greg Hennessy is currently offline  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.
[Message index]
 
Read Message
Read Message
Previous Topic: how to calculate distance from pairs of latitude/longitude measurements?
Next Topic: tvimage with log axis?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 03:12:20 PDT 2025

Total time taken to generate the page: 1.76120 seconds