Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Hi, I want to calculate distance..

7 views
Skip to first unread message

Deepak

unread,
Nov 12, 2009, 7:41:05 AM11/12/09
to
Hi all,
I am new in this group.
I want to calculate distance between two latitude,longitude.

could any one the formula..

Please help me..
Thanks

Roger Mills

unread,
Nov 12, 2009, 8:18:06 AM11/12/09
to
In an earlier contribution to this discussion,
Deepak <deepaksin...@gmail.com> wrote:

Approx how far apart are the points, and how accurate do you need the answer
to be?
--
Cheers,
Roger
______
Email address maintained for newsgroup use only, and not regularly
monitored.. Messages sent to it may not be read for several weeks.
PLEASE REPLY TO NEWSGROUP!


Sam Wormley

unread,
Nov 12, 2009, 11:49:05 AM11/12/09
to
Deepak wrote:

> I want to calculate distance between two latitude,longitude.

Aviation Formulary V1.44
http://williams.best.vwh.net/avform.html

HIPAR

unread,
Nov 12, 2009, 2:19:24 PM11/12/09
to

Assuming you are looking for the shortest distance between
start and finish points anywhere on the globe, this is a spherical
earth formula from Aviation Formulary coded in Pascal:

{Distance calculations from (Lat1, Lon1) to (Lat2, Lon2)}

function GcDis(const Lat1, Lon1, Lat2, Lon2: Double): Double;
begin
Result := 2*ArcSin(Sqrt(Sqr(Sin((Lat1-Lat2)/2)) +
Cos(Lat1)*Cos(Lat2)*Sqr(Sin((Lon1-Lon2)/2))));
end

You need to convert lat and lon to radians and then convert the
result from radians to your distance units. The spherical earth
model can be in error by several percent depending on the the
direction between the start and finish points.

This formula is very well behaved for small distance and handles
special cases properly.

There is a more complex formula available using the method of
Andoyer-Lambert that is more accurate for a ellipsoid shaped
earth. I have Pascal Code for it.

If the ultimate accuracy is required, you will need an iterative
algorithm such as the one developed by Thaddeus Vincenty.

Have fun.

--- CHAS

Don B

unread,
Nov 13, 2009, 5:55:04 AM11/13/09
to
There is a free piece of software from Mentor Software called
Forward/Inverse that will do what you want to do. I don't have their
site bookmarked, but you should be able to Google them.

dreamcachers

unread,
Nov 13, 2009, 2:36:31 PM11/13/09
to

Hello,

When I was deep into geocaching, I wrote a bunch of utility routines.
One of them is called Vincenty, which will do exactly what you want
with great accuracy on the WGS84 Spheroid. You can find the routines
(free) here: http://dreamcachers.com/geocaching/DreamcachersWare.zip .

BDR-529

unread,
Nov 14, 2009, 3:14:59 AM11/14/09
to

I typed in google:

"tool to calculate and display distances on a map"

and it found:

http://www.daftlogic.com/projects-google-maps-distance-calculator.htm

Good riddance,

Q

Keith

unread,
Nov 17, 2009, 5:39:50 PM11/17/09
to

Others have replied with the formulas, here is a website that will do
it for you : http://www.csgnetwork.com/gpsdistcalc.html

0 new messages