Distance Calculation Algorithms
Explanation of terms
|L1||=||latitude at the first point (degrees)|
|L2||=||latitude at the second point (degrees)|
|G1||=||longitude at the first point (degrees)|
|G2||=||longitude at the second point (degrees)|
|DG||=||longitude of the second point minus longitude of the first point (degrees)|
|DL||=||latitude of the second point minus latitude of the first point (degrees)|
|D||=||computed distance (km)|
- South latitudes are negative
- East longitudes are positive
- Great circle distance is the shortest distance between two points on a sphere. This coincides with the circumference of a circle which passes through both points and the centre of the sphere
- Geodesic distance is the shortest distance between two points on a spheroid
- Normal section distance is formed by a plane on a spheroid containing a point at one end of the line and the normal of the point at the other end. For all practical purposes, the difference between a normal section and a geodesic distance is insignificant.
Great Circle Distance (based on Spherical trigonometry)This method calculates the great circle distance, and is based on spherical trigonometry, and assumes that:
- 1 minute of arc is 1 nautical mile
- 1 nautical mile is 1.852 km.
D = 1.852 * 60 * ARCOS ( SIN(L1) * SIN(L2) + COS(L1) * COS(L2) * COS(DG))
Note: If your calculator returns the ARCOS result as radians, you will have to convert the radians to degrees before multiplying by 60 and 1.852 degrees = (radians/PI)*180, where PI=3.141592654.
Spheroidal model for the Earth
This method assumes a spheroidal model for the Earth with an average radius of 6364.963km. It has been derived for use within Australia.
The formula is estimated to have an accuracy of about 200 metres over 50km, but may deteriorate with longer distances.
|TERM1||=||111.08956 * (DL + 0.000001)|
|TERM2||=||COS(L1 + (DL/2)|
|TERM3||=||(DG + 0.000001) / (DL + 0.000001)|
|D||=||TERM1 / COS(ARCTAN(TERM2 * TERM3))|
Comparison of methods
The Table below shows distances calculated by each of the methods above. Vincenty's formulae (method 3), is the "best" answer and can be used for comparison with the others.
However, remember that the different methods compute different types of distance (great circle, geodesic etc), and you must decide which type of system (distance) you wish to use.
The test lines shown are neither exhaustive nor complete, but are indicative of the accuracies which may be obtained. Method 4 uses the GRS80 ellipsoid, which is used with Geocentric Datum of Australia (GDA) coordinate system. This ellipsoid is effectively the same as the WGS84 ellipsoid used with the Global Positioning System (GPS). All distances are in kilometres.
|Method 1||Method 2||Method 3|
|To||Great Circle||Approx. ellip.||Vincenty's|