Geographical distance or geodetic distance is the distance measured along the surface of the Earth, or the shortest arc length. The formulae in this article calculate distances between points which are defined by geographical coordinates in terms of latitude and longitude. This distance is an element in solving the second (inverse) geodetic problem.
Introduction Calculating the distance between geographical coordinates is based on some level of abstraction; it does not provide an exact distance, which is unattainable if one attempted to account for every irregularity in the surface of the Earth. Common abstractions for the surface between two geographic points are:
Flat surface; Spherical surface; Ellipsoidal surface. All abstractions above ignore changes in elevation. Calculation of distances which account for changes in elevation relative to the idealized surface are not discussed in this article.
Classification of Formulae based on Approximation short-range approximations: Flat surface, Gauss-mid-latitude; max|ΔDerror|∝D3 Bowring's method (1981) for short lines improved by Karney using reduces latitude and mid-latitude; max|ΔDerror|∝D4 long-range approximations; max|ΔDerror|∝D on the closed hemisphere f0-order approximation method: Spherical earth higher-order approximations based on Ellipsoid: f1: Andoyer(1932); Andoyer-Lambert(1942), f2: Andoyer-Lambert-Thomas(1970), f3: Vincenty(1975), f6: Karney(2011) The theoretical estimations of error are added in above and f is the flattening of the Earth.
Nomenclature Arc distance, D, is the minimum distance along the surface of sphere/ellipsoid calculated between two points, P1 and P2. Whereas, the tunnel distance, or chord length, Dt, is measured along Cartesian straight line. The geographical coordinates of the two points, as (latitude, longitude) pairs, are (ϕ1,λ1) and (ϕ2,λ2), respectively. Which of the two points is designated as P1 is not important for the calculation of distance. Latitude ϕ and longitude λ coordinates on maps are usually expressed in degrees. In the given forms of the formulae below, one or more values must be expressed in the specified units to obtain the correct result. Where geographic coordinates are used as the argument of a trigonometric function, the values may be expressed in any angular units compatible with the method used to determine the value of the trigonometric function. Many electronic calculators allow calculations of trigonometric functions in either degrees or radians. The calculator mode must be compatible with the units used for geometric coordinates. Differences in latitude and longitude are labeled and calculated as follows:
Δϕ=ϕ2−ϕ1;Δλ=λ2−λ1. It is not important whether the result is positive or negative when used in the formulae below. "Mid-latitude" is labeled and calculated as follows:
ϕm=ϕ1+ϕ22. Unless specified otherwise, the radius of the Earth for the calculations below is:
R = 6,371.009 kilometers = 3,958.761 statute miles = 3,440.069 nautical miles. D = Distance between the two points, as measured along the surface of the Earth and in the same units as the value used for radius unless specified otherwise.
Singularities and discontinuity of latitude/longitude The approximation of sinusoidal functions of Δλ, appearing in some flat-surface formulae below, may induce singularity and discontinuity. It may also degrade the accuracy in the case of higher latitude. Longitude has singularities at the Poles (longitude is undefined) and a discontinuity at the ±180° meridian. Also, planar projections of the circles of constant latitude are highly curved near the Poles. Hence, the above equations for delta latitude/longitude (Δϕ, Δλ) and mid-latitude (ϕm) may not give the expected answer for positions near the Poles or the ±180° meridian. Consider e.g. the value of Δλ ("east displacement") when λ1 and λ2 are on either side of the ±180° meridian, or the value of ϕm ("mid-latitude") for the two positions (ϕ1=89°, λ1=45°) and (ϕ2=89°, λ2=−135°). If a calculation based on latitude/longitude should be valid for all Earth positions, it should be verified that the discontinuity and the Poles are handled correctly. Another solution is to use n-vector instead of latitude/longitude, since this representation does not have discontinuities or singularities.
Flat-surface approximation formulae for very short distance A planar approximation for the surface of the Earth may be useful over very small distances. It approximates the arc length, D, to the tunnel distance, Dt, or omits the conversion between arc and chord lengths shown below. The shortest distance between two points in plane is a Cartesian straight line. The Pythagorean theorem is used to calculate the distance between points in a plane. Even over short distances, the accuracy of geographic distance calculations which assume a flat Earth depend on the method by which the latitude and longitude coordinates have been projected onto the plane. The projection of latitude and longitude coordinates onto a plane is the realm of cartography. The formulae presented in this section provide varying degrees of accuracy.
Spherical Earth approximation formulae The tunnel distance, Dt, is calculated on Spherical Earth. This formula takes into account the variation in distance between meridians with latitude, assuming D≈Dt:
Dt=2R(sinΔϕ2cosΔλ2)2+(cosϕmsinΔλ2)2≈R(ΔϕcosΔλ2)2+(2cosϕmsinΔλ2)2 . The square root appearing above can be eliminated for such applications as ordering locations by distance in a database query. On the other hand, some methods for computing nearest neighbors, such as the vantage-point tree, require that the distance metric obey the triangle inequality, in which case the square root must be retained.
In the case of medium or low latitude Although not being universal, the above is furthermore simplified by approximating sinusoidal functions of Δλ2, justified except for high latitude:
D≈R(Δϕ)2+(cos(ϕm)Δλ)2.
Ellipsoidal Earth approximation formulae The above formula is extended for ellipsoidal Earth:
… excerpt ends here. Continue reading the full article.



