Converting Lat-Long Coordinates to Absolute Distance - Flat Earth

Oct 10, 2005 8 Replies

Hello All,



Can somebody help me out, please?



I need to convert two lat-long coordinates to straight line distances (feet or meters is fine). For the distances involved, I can assume a "flat earth". :-)



I started Google searching but stumbled into some lengthy curved earth math. Just looking for something orthogonally simple.



TIA, Andy



Andy,

Try this great circle calculator.

formatting link
Mario

Andy Eng wrote:

Hi Andy: If the latitude is low you can use the Pythagorean Theorem: distance= sqrt( (lat1-lat2)^2 + (lon1-lon2)^2 ) to get the separation in degrees. At the equator a degree is a nautical mile, so you're done. A nautical mile is about 6076 feet.

But remember that while a degree of longitude is a nautical mile at the equator, it is zero miles at the pole. You'll only be off by about 40% with the longitude portion at 38 degrees latitude.

If you just want to do this > Hello All,

CHAD solution: enter both sets of coordinates into a hand held GPS, and let the GPS figure out the distance between the points!

Here's some code, if you do that:

'/* compute inner product on unit sphere */ slInner = Sin(slLat1) * Sin(slLat2) + Cos(slLat1) * Cos(slLat2) * Cos(slLon1 - slLon2)

'/* compute arc cosine of that inner product, avoiding possible ' computational inaccuracies that would induce overflow */ If slInner >= 1 Then slArc = 0 ElseIf slInner

Here's something I was reading this weekend that might help:

formatting link
Also, there's Google Earth.
formatting link
Get the free version, and you can use ctrl-6 to measure. Not quite as easy as just entering two coordinates, but almost.

Roy nar12605

Why would we add that error checking?

sin * sin + cos* cos cannot exceed 1, or -1 and cos(L1-L2) also cannot exceed 1 or -1

methinks, for now.

Just searching for may pocket calc... :-)

w.

Not all computers/languages play nice that way...

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required