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 #65607 is a reply to message #65606] Wed, 11 March 2009 13:33 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
llo writes:

> I tried the following formula I found in your link:
>
> Distance between points
>
> The great circle distance d between two points with coordinates
> {lat1,lon1} and {lat2,lon2} is given by:
>
> 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 ????

Try MAP_2POINTS in the IDL distribution.

Cheers,

David

--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: OpenADDE and IDL
Next Topic: Need Help Resolving ENDIF Errors

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

Current Time: Sun Nov 30 22:00:03 PST 2025

Total time taken to generate the page: 2.07362 seconds