Distance between 2 points
Thread Starter
Join Date: Jan 2004
Location: LPPT
Age: 58
Posts: 431
Likes: 0
Received 0 Likes
on
0 Posts
Distance between 2 points
Hi All
I'm seeking a valid formula for calculating the distance between 2 points on the earth globe, giving the Lat's / Lon's from both places.
I've tried two or three formulas but when comparing results with actual charts, I always get different distances.
Can someone give me a hand here?
Thanks in advance.
I'm seeking a valid formula for calculating the distance between 2 points on the earth globe, giving the Lat's / Lon's from both places.
I've tried two or three formulas but when comparing results with actual charts, I always get different distances.
Can someone give me a hand here?
Thanks in advance.
Join Date: Nov 2001
Location: KUL
Posts: 214
Likes: 0
Received 0 Likes
on
0 Posts
Join Date: May 2003
Location: I'm the asshole next door
Age: 61
Posts: 177
Likes: 0
Received 0 Likes
on
0 Posts
Join Date: Apr 2000
Location: West Midlands, UK.
Age: 73
Posts: 294
Likes: 0
Received 0 Likes
on
0 Posts
Departure (n.m.) = Ch.Long (min) x cos.lat
1 A flight is to be made along the parallel of latitude from A at 48 °00N 04°00'W to B at 48°00N 02°27E. Calculate the distance. (259nm)
1 A flight is to be made along the parallel of latitude from A at 48 °00N 04°00'W to B at 48°00N 02°27E. Calculate the distance. (259nm)
Join Date: Apr 2002
Location: Bohol, Philippines
Posts: 150
Likes: 0
Received 0 Likes
on
0 Posts
The great circle distance d between two points with coordinates {lat1,lon1} and {lat2,lon2} is given by:
Dist=acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon1-lon2))
Dist=acos(sin(lat1)*sin(lat2)+cos(lat1)*cos(lat2)*cos(lon1-lon2))
Join Date: Aug 2003
Location: Scotland
Posts: 240
Likes: 0
Received 0 Likes
on
0 Posts
A small clarification to the last...
SFI145's formula is completely correct, but for the benefit of those at the back of the maths class who may not have been keeping up, I'd add a small word about units, especially for those of you typing the formula into your favourite spreadsheet.
Your favourite spreadsheet probably does sines and cosines of angles in radians, and the formula shown works great if your Lat and Long pairs are in radians, at which point it also gives you the answer in Great Circle radians.
For those of you who started with Lat/Long in degrees, and wanted the answer in nautical miles - first convert your degrees into radians by multiplying by (pi/180), and convert the radian answer back into degrees by using the opposite (180/pi). Finally, to get from great circle degrees to nautical miles, multiply by 60.
Your favourite spreadsheet probably does sines and cosines of angles in radians, and the formula shown works great if your Lat and Long pairs are in radians, at which point it also gives you the answer in Great Circle radians.
For those of you who started with Lat/Long in degrees, and wanted the answer in nautical miles - first convert your degrees into radians by multiplying by (pi/180), and convert the radian answer back into degrees by using the opposite (180/pi). Finally, to get from great circle degrees to nautical miles, multiply by 60.
The formulas above will be slightly different to charts as charts are projected onto a spheriod, normally the WGS84 ellipsopid.
The formula results above will agree directly with unprojected data, or an unprojected map.
The WGS84 ellipsoid is flatter at the poles than a perfect sphere, hence the spherical geometry answers you received above will have a small error as a result of the projection.
The formula results above will agree directly with unprojected data, or an unprojected map.
The WGS84 ellipsoid is flatter at the poles than a perfect sphere, hence the spherical geometry answers you received above will have a small error as a result of the projection.
PPRuNeaholic
Join Date: Jun 2000
Location: Cairns FNQ
Posts: 3,255
Likes: 0
Received 0 Likes
on
0 Posts
To add just a little to the post by CJ Driver... if you're starting with latitude and longitude in the standard format of degrees, minutes and seconds (to however many decimals), first convert it all to degrees. Then convert to radians in the way that he (or she) has described.
The conversion is simple enough, just divide the minutes by 60, then divide the seconds by 3600, then add the lot to the degrees.
If you've started with the coordinate format on a chart, it will be in degrees and minutes (to a couple of decimal places). The conversion for this is even simpler because you only have to contend with the minutes.
You might still end up with an error of a mile or more, depending on the datum used in the chart. The formula for deriving distance, as posted by SFI145 is a catch-all that should work pretty well for the WGS-84 datum, but not be all that great with any of the myriad of other datums that are available.
In any event, you might end up with a slightly different answer to that shown on a chart. This will be due to factors such as the way the distance is rounded for chart use. Also, on whether the chart distance was calculated using the actual coordinates, or the decimalised version of the same.
The conversion is simple enough, just divide the minutes by 60, then divide the seconds by 3600, then add the lot to the degrees.
If you've started with the coordinate format on a chart, it will be in degrees and minutes (to a couple of decimal places). The conversion for this is even simpler because you only have to contend with the minutes.
You might still end up with an error of a mile or more, depending on the datum used in the chart. The formula for deriving distance, as posted by SFI145 is a catch-all that should work pretty well for the WGS-84 datum, but not be all that great with any of the myriad of other datums that are available.
In any event, you might end up with a slightly different answer to that shown on a chart. This will be due to factors such as the way the distance is rounded for chart use. Also, on whether the chart distance was calculated using the actual coordinates, or the decimalised version of the same.
In case it's not yet clear
First caveat: lat-lons don't come scribed on stone tablets. The lat-lon of a given point in the US or Europe (or most anywhere else, probably) has changed over the last few decades, not because the point has moved but because we're now calculating it differently. Some places have "moved" a few hundred meters on that account. (Or farther?)
So if you want accuracy to better than, say, 10 meters you need to know which system of lat-lons you're using. Then:
Next you decide what accuracy you need. SFI145 gave the usual formula for a spherical earth, which in extreme cases will be off by twenty miles or so (since the earth isn't spherical). If that's not good enough, you can choose between (among others)
Lambert's formulas, which are fairly simple and accurate to 5-10? meters over almost any distance
Bowring's short-distance formulas, which are fairly simple and accurate to a few millimeters for points up to 100 km apart
More complicated iterative formulas that are accurate to a millimeter for points less than 19500 km apart.
You can program any of them into your pocket calculator. Or, if you just want the answer, you can use Ed Williams' site linked above, or the NGS website, which will do the iterative calculation for you, accurate to a millimeter. I think they both fail if the two points are too close to antipodal.
So if you want accuracy to better than, say, 10 meters you need to know which system of lat-lons you're using. Then:
Next you decide what accuracy you need. SFI145 gave the usual formula for a spherical earth, which in extreme cases will be off by twenty miles or so (since the earth isn't spherical). If that's not good enough, you can choose between (among others)
Lambert's formulas, which are fairly simple and accurate to 5-10? meters over almost any distance
Bowring's short-distance formulas, which are fairly simple and accurate to a few millimeters for points up to 100 km apart
More complicated iterative formulas that are accurate to a millimeter for points less than 19500 km apart.
You can program any of them into your pocket calculator. Or, if you just want the answer, you can use Ed Williams' site linked above, or the NGS website, which will do the iterative calculation for you, accurate to a millimeter. I think they both fail if the two points are too close to antipodal.