Geographical distance or geodetic distance is the distance measured along the surface of the Earth, or the shortest arch 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.
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.[1] Common abstractions for the surface between two geographic points are:
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.
|\DeltaDerror|\proptoD3
|\DeltaDerror|\proptoD
f1
f2
f3
f6
\Delta|Derror|\proptoD
The theoretical estimations of error are added in above and
f
Arc distance,
D,
P1
P2
Drm{t}
(\phi1,λ1)
(\phi2,λ2),
P1
Latitude
\phi
λ
Differences in latitude and longitude are labeled and calculated as follows:
\begin{align} \Delta\phi&=\phi2-\phi1;\\ \Deltaλ&=λ2-λ1. \end{align}
It is not important whether the result is positive or negative when used in the formulae below.
"Mean latitude" is labeled and calculated as follows:
\phi | ||||
|
.
Unless specified otherwise, the radius of the Earth for the calculations below is:
R
D
The approximation of sinusoidal functions of
\Deltaλ
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 (
\Delta\phi
\Deltaλ
\phim
\Deltaλ
λ1
λ2
\phim
\phi1
λ1
\phi2
λ2
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.
A planar approximation for the surface of the Earth may be useful over very small distances. It approximates the arc length,
D
Drm{t}
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.
This formula takes into account the variation in distance between meridians with latitude:
\begin{align} D&=R\sqrt{\left(2\sin
\Delta\phi | |
2 |
\cos
\Deltaλ | |
2 |
\right)2+\left(2\cos\phirm{m}\sin
\Deltaλ | |
2 |
\right)2}\\ & ≈ R\sqrt{\left(\Delta\phi\cos
\Deltaλ | |
2 |
\right)2+\left(2\cos\phirm{m}\sin
\Deltaλ | |
2 |
\right)2} . \end{align}
The above is furthermore simplified by approximating sinusoidal functions of
\Deltaλ | |
2 |
2} | |
D=R\sqrt{(\Delta\phi) | |
m)\Deltaλ) |
This approximation is very fast and produces fairly accurate result for small distances . Also, when ordering locations by distance, such as in a database query, it is faster to order by squared distance, eliminating the need for computing the square root.
The above formula is extended for ellipsoidal Earth:
D=\sqrt{\left(M\left(\phirm{m}\right)\Delta\phi\cos
\Deltaλ | |
2 |
\right)2+\left(2N\left(\phirm{m}\right)\cos\phirm{m}\sin
\Deltaλ | |
2 |
\right)2}
M
N
It is derived by the approximation of
\left(\cos
\phi | ||||
|
\Delta\phi\right)2 ≈ 0
The above is furthermore simplified by approximating sinusoidal functions of
\Deltaλ | |
2 |
2+(N(\phi | |
D=\sqrt{(M(\phi | |
m)\cos\phi |
2}. | |
m\Deltaλ) |
The FCC prescribes the following formulae for distances not exceeding 475km (295miles):[4]
2}, | |
D=\sqrt{(K | |
2\Deltaλ) |
where
D
\Delta\phi
\Deltaλ
\phim
\cos\phim;
\begin{align} K1&=111.13209-0.56605\cos(2\phim)+0.00120\cos(4\phim);\\ K2&=111.41513\cos(\phim)-0.09455\cos(3\phim)+0.00012\cos(5\phim).\end{align}
Where
K1
K2
K1=M(\phi
|
K2=\cos(\phim)N(\phi
|
Note that the expressions in the FCC formula are derived from the truncation of the binomial series expansion form of
M
N
2 | |
D=R\sqrt{\theta | |
2 - 2\theta |
1\theta2\cos(\Deltaλ)},
where the colatitude values are in radians:
\theta= | \pi |
2 |
-\phi.
For a latitude measured in degrees, the colatitude in radians may be calculated as follows:
\theta= | \pi |
180 |
(90\circ-\phi).
See main article: Great-circle distance. If one is willing to accept a possible error of 0.5%, one can use formulas of spherical trigonometry on the sphere that best approximates the surface of the Earth.
The shortest distance along the surface of a sphere between two points on the surface is along the great-circle which contains the two points.
The great-circle distance article gives the formula for calculating the shortest arch length
D
Drm{t}
D=2R\arcsin
Drm{t | |
For short distances (
D\llR
D=Drm{t}\left(1+
1 | \left( | |
24 |
Drm{t | |
A tunnel between points on Earth is defined by a Cartesian line through three-dimensional space between the points of interest.The tunnel distance
Drm{t}=2R\sin
D | |
2R |
\begin{align} \Delta{X}&=\cos(\phi2)\cos(λ2)-\cos(\phi1)\cos(λ1);\\ \Delta{Y}&=\cos(\phi2)\sin(λ2)-\cos(\phi1)\sin(λ1);\\ \Delta{Z}&=\sin(\phi2)-\sin(\phi1);\\ D
2 | |
rm{t}&=R\sqrt{(\Delta{X}) |
+(\Delta{Y})2+(\Delta{Z})2}\\ &=2R
| ||||
\sqrt{\sin |
+
| ||||
\left(\cos |
-
| ||||
\sin | ||||
rm{m}\right)\sin |
See main article: Geodesics on an ellipsoid.
An ellipsoid approximates the surface of the Earth much better than asphere or a flat surface does. The shortest distance along the surfaceof an ellipsoid between two points on the surface is along thegeodesic. Geodesics follow more complicated paths than greatcircles and in particular, they usually don't return to their startingpositions after one circuit of the Earth. This is illustrated in thefigure on the right where f is taken to be 1/50 to accentuate theeffect. Finding the geodesic between two points on the Earth, theso-called inverse geodetic problem, was the focus of manymathematicians and geodesists over the course of the 18th and 19thcenturies with major contributions byClairaut,[5] Legendre,[6] Bessel,[7] and Helmert English translation of Astron. Nachr. 4, 241–254 (1825). Errata.[8] Rapp[9] provides a good summary of this work.
Methods for computing the geodesic distance are widely available ingeographical information systems, software libraries, standaloneutilities, and online tools. The most widely used algorithm is byVincenty,[10] who uses a series which is accurate to third order in the flattening ofthe ellipsoid, i.e., about 0.5 mm; however, the algorithm fails toconverge for points that are nearly antipodal. (Fordetails, see Vincenty's formulae.) This defect is cured in thealgorithm given byKarney,[11] who employs series which are accurate to sixth order in the flattening.This results in an algorithm which is accurate to full double precisionand which converges for arbitrary pairs of points on the Earth. Thisalgorithm is implemented in GeographicLib.[12]
The exact methods above are feasible when carrying out calculations on acomputer. They are intended to give millimeter accuracy on lines of anylength; one can use simpler formulas if one doesn't need millimeteraccuracy, or if one does need millimeter accuracy but the line is short.
The short-line methods have been studied by several researchers. Rapp,[13] Chap. 6, describes the Puissant method,the Gauss mid-latitude method, and the Bowring method.[14] Karl Hubeny[15] got the expanded series of Gauss mid-latitude one represented as the correction to flat-surface one.
f
Lambert's formulae[18] use the first-order correction and reduced latitude,
\beta=\arctan\left((1-f)\tan\phi\right)
First convert the latitudes
\scriptstyle\phi1
\scriptstyle\phi2
\scriptstyle\beta1
\scriptstyle\beta2
\sigma
(\beta1, λ1)
(\beta2, λ2)
λ1
λ2
P=
\beta1+\beta2 | |
2 |
Q=
\beta2-\beta1 | |
2 |
X=(\sigma-\sin\sigma)
\sin2P\cos2Q | |||||
|
Y=(\sigma+\sin\sigma)
\cos2P\sin2Q | |||||
|
,
where
a
On the GRS 80 spheroid Lambert's formula is off by
0 North 0 West to 40 North 120 West, 12.6 meters
0N 0W to 40N 60W, 6.6 meters
40N 0W to 40N 60W, 0.85 meter
It has the similar form of the arc length converted from tunnel distance. Detailed formulas are given by Rapp,[13] §6.4. It is consistent with the above-mentioned flat-surface formulae apparently.
D=2N\left(\phirm{m}\right)\arcsin\sqrt{\left(\sin
\Deltaλ | |
2 |
2 | |
\cos\phi | |
rm{m}\right) |
+\left(\cos
\Deltaλ | |
2 |
\sin\left(
\Delta\phi | |
2 |
M\left(\phirm{m | |
\right)}{N\left(\phi |
2}. | |
rm{m}\right)}\right)\right) |
Bowring maps the points to a sphere of radius R′, with latitude and longitude represented as φ′ and λ′. Define
A=\sqrt{1+e'2\cos4\phi1}, B=\sqrt{1+e'2\cos2\phi1},
e'2=
a2-b2 | |
b2 |
=
f(2-f) | |
(1-f)2 |
.
R'=
\sqrt{1+e'2 | |
\begin{align} \tan\phi1'&=
\tan\phi1 | |
B,\\ \Delta\phi' |
&=
\Delta\phi | |
B |
l[1+
3e'2 | |
4B2 |
(\Delta\phi)\sin(2\phi1+\tfrac23\Delta\phi)r],\\ \Deltaλ'&=A\Deltaλ, \end{align}
\Delta\phi=\phi2-\phi1
\Delta\phi'=\phi2'-\phi1'
\Deltaλ=λ2-λ1
\Deltaλ'=λ2'-λ1'
The variation in altitude from the topographical or ground level down to the sphere's or ellipsoid's surface, also changes the scale of distance measurements.[20] The slant distance s (chord length) between two points can be reduced to the arc length on the ellipsoid surface S as:[21]
S-s=-0.5(h1+h2)s/R-0.5(h1-h
2/s | |
2) |