![Roßberg Alpen 1](https://upload.wikimedia.org/wikipedia/commons/b/b2/Ro%C3%9Fberg_Alpen_1.14_2006.jpg)
Geographical distance or geodetic distance is the
distance
Distance is a numerical or occasionally qualitative measurement of how far apart objects or points are. In physics or everyday usage, distance may refer to a physical length or an estimation based on other criteria (e.g. "two counties over"). ...
measured along the surface of the
earth
Earth is the third planet from the Sun and the only astronomical object known to harbor life. While large volumes of water can be found throughout the Solar System, only Earth sustains liquid surface water. About 71% of Earth's surfa ...
. The formulae in this article calculate distances between points which are defined by
geographical coordinates
The geographic coordinate system (GCS) is a spherical or ellipsoidal coordinate system for measuring and communicating positions directly on the Earth as latitude and longitude. It is the simplest, oldest and most widely used of the vario ...
in terms of
latitude
In geography, latitude is a coordinate that specifies the north– south position of a point on the surface of the Earth or another celestial body. Latitude is given as an angle that ranges from –90° at the south pole to 90° at the north pol ...
and
longitude
Longitude (, ) is a geographic coordinate that specifies the east–west position of a point on the surface of the Earth, or another celestial body. It is an angular measurement, usually expressed in degrees and denoted by the Greek letter l ...
. 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.
Nomenclature
Distance,
is calculated between two points,
and
. The geographical coordinates of the two points, as (latitude, longitude) pairs, are
and
respectively. Which of the two points is designated as
is not important for the calculation of distance.
Latitude and longitude coordinates on maps are usually expressed in
degree
Degree may refer to:
As a unit of measurement
* Degree (angle), a unit of angle measurement
** Degree of geographical latitude
** Degree of geographical longitude
* Degree symbol (°), a notation used in science, engineering, and mathematics
...
s. 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
radian
The radian, denoted by the symbol rad, is the unit of angle in the International System of Units (SI) and is the standard unit of angular measure used in many areas of mathematics. The unit was formerly an SI supplementary unit (before that c ...
s. The calculator mode must be compatible with the units used for geometric coordinates.
Differences in latitude and longitude are labeled and calculated as follows:
:
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:
:
Colatitude is labeled and calculated as follows:
:For latitudes expressed in radians:
::
:For latitudes expressed in degrees:
::
Unless specified otherwise, the
radius
In classical geometry, a radius ( : radii) of a circle or sphere is any of the line segments from its center to its perimeter, and in more modern usage, it is also their length. The name comes from the latin ''radius'', meaning ray but also the ...
of the earth for the calculations below is:
:
= 6,371.009 kilometers = 3,958.761 statute miles = 3,440.069
nautical mile
A nautical mile is a unit of length used in air, marine, and space navigation, and for the definition of territorial waters. Historically, it was defined as the meridian arc length corresponding to one minute ( of a degree) of latitude. Today ...
s.
= 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
Longitude has
singularities at the
Poles
Poles,, ; singular masculine: ''Polak'', singular feminine: ''Polka'' or Polish people, are a West Slavic nation and ethnic group, who share a common history, culture, the Polish language and are identified with the country of Poland in Ce ...
(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
Delta commonly refers to:
* Delta (letter) (Δ or δ), a letter of the Greek alphabet
* River delta, at a river mouth
* D ( NATO phonetic alphabet: "Delta")
* Delta Air Lines, US
* Delta variant of SARS-CoV-2 that causes COVID-19
Delta may also ...
latitude/longitude (
,
) and mean latitude (
) may not give the expected answer for positions near the Poles or the ±180° meridian. Consider e.g. the value of
("east displacement") when
and
are on either side of the ±180° meridian, or the value of
("mean latitude") for the two positions (
=89°,
=45°) and (
=89°,
=−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 formulae
A planar approximation for the surface of the earth may be useful over small distances. The accuracy of distance calculations using this approximation become increasingly inaccurate as:
* The separation between the points becomes greater;
* A point becomes closer to a geographic pole.
The shortest distance between two points in plane is a straight line. The
Pythagorean theorem
In mathematics, the Pythagorean theorem or Pythagoras' theorem is a fundamental relation in Euclidean geometry between the three sides of a right triangle. It states that the area of the square whose side is the hypotenuse (the side opposite t ...
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
Projected is an American rock supergroup consisting of Sevendust members John Connolly and Vinnie Hornsby, Alter Bridge and Creed drummer Scott Phillips, and former Submersed and current Tremonti guitarist Eric Friedman. The band released t ...
onto the plane. The projection of latitude and longitude coordinates onto a plane is the realm of
cartography
Cartography (; from grc, χάρτης , "papyrus, sheet of paper, map"; and , "write") is the study and practice of making and using maps. Combining science, aesthetics and technique, cartography builds on the premise that reality (or an im ...
.
The formulae presented in this section provide varying degrees of accuracy.
Spherical Earth projected to a plane
This formula takes into account the variation in distance between meridians with latitude:
:
:where:
::
and
are in radians;
::
must be in units compatible with the method used for determining
:To convert latitude or longitude to radians use
::
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.
Ellipsoidal Earth projected to a plane
The
FCC
The Federal Communications Commission (FCC) is an independent agency of the United States federal government that regulates communications by radio, television, wire, satellite, and cable across the United States. The FCC maintains jurisdictio ...
prescribes the following formulae for distances not exceeding :
:
:where
::
= Distance in kilometers;
::
and
are in degrees;
::
must be in units compatible with the method used for determining
::
:Where
and
are in units of kilometers per degree. It may be interesting to note that:
::
= kilometers per degree of latitude difference;
::
= kilometers per degree of longitude difference;
::where
and
are the ''meridional'' and its perpendicular, or "''normal''",
radii of curvature (the expressions in the FCC formula are derived from the
binomial series
In mathematics, the binomial series is a generalization of the polynomial that comes from a binomial formula expression like (1+x)^n for a nonnegative integer n. Specifically, the binomial series is the Taylor series for the function f(x)=(1+x) ...
expansion form of
and
, set to the ''Clarke 1866''
reference ellipsoid
An Earth ellipsoid or Earth spheroid is a mathematical figure approximating the Earth's form, used as a reference frame for computations in geodesy, astronomy, and the geosciences. Various different ellipsoids have been used as approximations ...
).
For a more computationally efficient implementation of the formula above, multiple applications of cosine can be replaced with a single application and use of recurrence relation for
Chebyshev polynomials
The Chebyshev polynomials are two sequences of polynomials related to the cosine and sine functions, notated as T_n(x) and U_n(x). They can be defined in several equivalent ways, one of which starts with trigonometric functions:
The Chebyshe ...
.
Polar coordinate flat-Earth formula
:
:where the colatitude values are in radians. For a latitude measured in degrees, the colatitude in radians may be calculated as follows:
Spherical-surface formulae
If one is willing to accept a possible error of 0.5%, one can use formulas of
spherical trigonometry
Spherical trigonometry is the branch of spherical geometry that deals with the metrical relationships between the sides and angles of spherical triangles, traditionally expressed using trigonometric functions. On the sphere, geodesics are gr ...
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
The great-circle distance, orthodromic distance, or spherical distance is the distance along a great circle.
It is the shortest distance between two points on the surface of a sphere, measured along the surface of the sphere (as opposed to a ...
article gives the formula for calculating the distance along a great-circle on a sphere about the size of the Earth. That article includes an example of the calculation.
Tunnel distance
A tunnel between points on Earth is defined by a line through three-dimensional space between the points of interest.
The great circle chord length may be calculated as follows for the corresponding unit sphere:
:
The tunnel distance between points on the surface of a spherical Earth is
. For short distances (
), this underestimates the great circle distance by
.
Ellipsoidal-surface formulae
![Long geodesic on an oblate ellipsoid](https://upload.wikimedia.org/wikipedia/commons/7/77/Long_geodesic_on_an_oblate_ellipsoid.svg)
An ellipsoid approximates the surface of the earth much better than a
sphere or a flat surface does. The shortest distance along the surface
of an ellipsoid between two points on the surface is along the
geodesic
In geometry, a geodesic () is a curve representing in some sense the shortest path ( arc) between two points in a surface, or more generally in a Riemannian manifold. The term also has meaning in any differentiable manifold with a connection. ...
. Geodesics follow more complicated paths than great
circles and in particular, they usually don't return to their starting
positions after one circuit of the earth. This is illustrated in the
figure on the right where ''f'' is taken to be 1/50 to accentuate the
effect. Finding the geodesic between two points on the earth, the
so-called
inverse geodetic problem, was the focus of many
mathematicians and geodesists over the course of the 18th and 19th
centuries with major contributions by
Clairaut,
Legendre,
Bessel,
and
Helmert
Friedrich Robert Helmert (31 July 1843 – 15 June 1917) was a German geodesist and statistician with important contributions to the theory of errors.
Career
Helmert was born in Freiberg, Kingdom of Saxony. After schooling in Freiberg and D ...
.
Rapp
provides a good summary of this work.
Methods for computing the geodesic distance are widely available in
geographical information systems
A geographic information system (GIS) is a type of database containing geographic data (that is, descriptions of phenomena for which location is relevant), combined with software tools for managing, analyzing, and visualizing those data. In a br ...
, software libraries, standalone
utilities, and online tools. The most widely used algorithm is by
Vincenty,
who uses a series which is accurate to third order in the flattening of
the ellipsoid, i.e., about 0.5 mm; however, the algorithm fails to
converge for points that are nearly
antipodal. (For
details, see
Vincenty's formulae
Vincenty's formulae are two related iterative methods used in geodesy to calculate the distance between two points on the surface of a spheroid, developed by Thaddeus Vincenty (1975a). They are based on the assumption that the figure of the Eart ...
.) This defect is cured in the
algorithm given by
Karney,
who employs series which are accurate to sixth order in the flattening.
This results in an algorithm which is accurate to full double precision
and which converges for arbitrary pairs of points on the earth. This
algorithm is implemented in GeographicLib.
The exact methods above are feasible when carrying out calculations on a
computer. They are intended to give millimeter accuracy on lines of any
length; one can use simpler formulas if one doesn't need millimeter
accuracy, or if one does need millimeter accuracy but the line is short.
Rapp,
[
] Chap. 6, describes the
Puissant method,
the Gauss mid-latitude method, and the Bowring method.
[
]
Lambert's formula for long lines
Lambert's formulae
give accuracy on the order of 10 meters over thousands of kilometers. First convert the latitudes
,
of the two points to
reduced latitudes ,
:
where
is the
flattening
Flattening is a measure of the compression of a circle or sphere along a diameter to form an ellipse or an ellipsoid of revolution (spheroid) respectively. Other terms used are ellipticity, or oblateness. The usual notation for flattening is ...
.
Then calculate the
central angle
A central angle is an angle whose apex (vertex) is the center O of a circle and whose legs (sides) are radii intersecting the circle in two distinct points A and B. Central angles are subtended by an arc between those two points, and the arc le ...
in radians between two points
and
on a sphere using
the Great-circle distance method (
law of cosines
In trigonometry, the law of cosines (also known as the cosine formula, cosine rule, or al-Kashi's theorem) relates the lengths of the sides of a triangle to the cosine of one of its angles. Using notation as in Fig. 1, the law of cosines states ...
or
haversine formula The haversine formula determines the great-circle distance between two points on a sphere given their longitudes and latitudes. Important in navigation, it is a special case of a more general formula in spherical trigonometry, the law of haversines, ...
), with longitudes
and
being the same on the sphere as on the spheroid.
:
:
where
is the equatorial radius of the chosen spheroid.
On the
GRS 80
The Geodetic Reference System 1980 (GRS 80) is a geodetic reference system consisting of a global reference ellipsoid and a normal gravity model.
Background
Geodesy is the scientific discipline that deals with the measurement and representation ...
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
Bowring's method for short lines
Bowring maps the points to a sphere of radius ''R′'', with latitude and longitude represented as φ′ and λ′. Define
:
where the second eccentricity squared is
:
The spherical radius is
:
(The
Gaussian curvature
In differential geometry, the Gaussian curvature or Gauss curvature of a surface at a point is the product of the principal curvatures, and , at the given point:
K = \kappa_1 \kappa_2.
The Gaussian radius of curvature is the reciprocal of .
F ...
of the ellipsoid at φ
1 is 1/''R′''
2.)
The spherical coordinates are given by
:
where
,
,
,
. The resulting problem on the sphere may be solved using the techniques for
great-circle navigation
Great-circle navigation or orthodromic navigation (related to orthodromic course; from the Greek ''ορθóς'', right angle, and ''δρóμος'', path) is the practice of navigating a vessel (a ship or aircraft) along a great circle. Such rout ...
to give approximations for the spheroidal distance and bearing. Detailed formulas are given by Rapp,
[ §6.5 and Bowring.][
]
Altitude correction
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.
The slant distance ''s'' ( chord length) between two points can be reduced to the arc length
ARC may refer to:
Business
* Aircraft Radio Corporation, a major avionics manufacturer from the 1920s to the '50s
* Airlines Reporting Corporation, an airline-owned company that provides ticket distribution, reporting, and settlement services
* ...
on the ellipsoid surface ''S'' as:[Torge & Müller (2012) Geodesy, De Gruyter, p.249]
:
where ''R'' is evaluated from Earth's azimuthal radius of curvature and ''h'' are ellipsoidal height
Geodetic coordinates are a type of curvilinear orthogonal coordinate system used in geodesy based on a ''reference ellipsoid''.
They include geodetic latitude (north/south) , ''longitude'' (east/west) , and ellipsoidal height (also known as geod ...
s are each point.
The first term on the right-hand side of the equation accounts for the mean elevation and the second term for the inclination.
A further reduction of the above Earth normal section
Earth section paths are plane curves defined by the intersection of an earth ellipsoid and a plane ( ellipsoid plane sections). Common examples include the '' great ellipse'' (containing the center of the ellipsoid) and normal sections (contain ...
length to the ellipsoidal geodesic
The study of geodesics on an ellipsoid arose in connection with geodesy specifically with the solution of triangulation networks. The figure of the Earth is well approximated by an ''oblate ellipsoid'', a slightly flattened sphere. A ''geodesi ...
length is often negligible.
See also
*Arc measurement
Arc measurement, sometimes degree measurement (german: Gradmessung), is the astrogeodetic technique of determining of the radius of Earth – more specifically, the local Earth radius of curvature of the figure of the Earth – by relating the ...
*Earth radius
Earth radius (denoted as ''R''🜨 or R_E) is the distance from the center of Earth to a point on or near its surface. Approximating the figure of Earth by an Earth spheroid, the radius ranges from a maximum of nearly (equatorial radius, deno ...
*Spherical Earth
Spherical Earth or Earth's curvature refers to the approximation of figure of the Earth as a sphere.
The earliest documented mention of the concept dates from around the 5th century BC, when it appears in the writings of Greek philosophers. I ...
*Great-circle distance
The great-circle distance, orthodromic distance, or spherical distance is the distance along a great circle.
It is the shortest distance between two points on the surface of a sphere, measured along the surface of the sphere (as opposed to a ...
*Great-circle navigation
Great-circle navigation or orthodromic navigation (related to orthodromic course; from the Greek ''ορθóς'', right angle, and ''δρóμος'', path) is the practice of navigating a vessel (a ship or aircraft) along a great circle. Such rout ...
*Ground sample distance In remote sensing, ground sample distance (GSD) in a digital photo (such as an orthophoto) of the ground from air or space is the distance between pixel centers measured on the ground. For example, in an image with a one-meter GSD, adjacent pixels i ...
*Vincenty's formulae
Vincenty's formulae are two related iterative methods used in geodesy to calculate the distance between two points on the surface of a spheroid, developed by Thaddeus Vincenty (1975a). They are based on the assumption that the figure of the Eart ...
*Meridian arc
In geodesy and navigation, a meridian arc is the curve between two points on the Earth's surface having the same longitude. The term may refer either to a segment of the meridian, or to its length.
The purpose of measuring meridian arcs is to de ...
*Scale (map)
The scale of a map is the ratio of a distance on the map to the corresponding distance on the ground. This simple concept is complicated by the curvature of the Earth's surface, which forces scale to vary across a map. Because of this variation, ...
References
{{Reflist
External links
*A
online geodesic calculator
(based on GeographicLib).
*A
Cartography
Earth
Geodesy