PDA

View Full Version : Distance calculation (lats and longs)


???pax
16th Oct 2001, 20:18
Does anybody out there know of a quick and reasonably accurate formula for measuring the distance between two points specified in Lat/Long format??

I have come across scores of over-complex examples, mainly from astronomical sites, which I am sure are fine, but they are far too complex for what I am looking for.

I know that in the "real world" your computers work these figures out for you, but I would be grateful if anybody can provide me with an example.

Regards,
???pax

Oktas8
16th Oct 2001, 22:56
As far as quick & easy formulae go, the only two examples I know of relate to two points either on the same parallel or the same meridian.

Same parallel: "Departure":
dist = (change in longitude in degrees) x cosine (average latitude) x 60

Same longitude:
dist = change in latitude in degrees x 60.

A formula that works for E/W and N/S will use spherical trigonometry, and will appear to be immensely complex!

It has been covered a few times before on these forums. Try the search feature, going back two years.

cheers,
O8

Checkboard
17th Oct 2001, 06:50
.. or grit your teeth, and have a look at Ed Williams's Aviation Formulary V1.31 (http://www.best.com/~williams/avform.html) :eek:
Some great circle formulae:

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))

[ 17 October 2001: Message edited by: Checkboard ]

???pax
18th Oct 2001, 13:28
Cheers people. It looks like I am going to have to wipe that dust off my scientific calculator.

pterodactyl
18th Oct 2001, 17:19
Depends on what degree of accuracy you require and over what distance. The only precise method is by Spherical Trig calculation as per Ed Williams Formulas which are really a modern illustration of the old haversine method.

For distances less than 600 miles the Plane Sailing method using the theory of the superceeded Mercator projection gives a usable Rhumb line Track and Distance. Although the formulae appear simpler the method can still provide a headache mainly because Nautical tables of Meridional Parts(MPs) is needed and I doubt that they are readily available any more. I still have my trusty/dusty copy of Norie's Nautical Tables using a compression ratio of 1/293.465 for the Terrestrial Spheroid.

Briefly the MPs for each Latitude is obtained from the Table and the Difference(DMPs) is determined. Simply the DMPs are subtracted if the Latitudes are both of the same Equatorial orientation and added if on different sides of the Equator.

Next just find the difference in longitude(D Long)

Then you have two sides of a right angled triangle.

So:

Tan Track Angle = DLong / DMPs

and:

Distance = Change Latitude(In Minutes) * Secant Track Angle


Taking the Approximate Lat/Longs for Sydney and Melbourne as 3352S 15112E and 3750S 14459E Track and Distances work out at:

From Tables SY 3352S = 2148.8 and ML 3750S = 2441.23 DMPs = 292.43
Tan Track Angle DLong 373/DMPs 292.43
Track Angle is 51.9 Degrees South West from SY ie 180 + 51.9 = 231.9 True.

Now the easy? bit.
Lat SY - Lat ML 33.52 - 37.50 = 3.58 = 238'

Distance = Change Lat * Sec Track Angle
= 238 * Secant 51.9 Degrees
= 385.7nm
Haven't got a chart handy but that's not far out from memory.

And you think your head hurts :D

Just did a quick calc using spherical Trig...Distance comes out at close to 399nm so there is a distance error of 14nm in 400 =
3.5% Track is not far off but would differ more at higher Lats.

[ 18 October 2001: Message edited by: pterodactyl ]