
Distance is a numerical or occasionally qualitative
measurement of how far apart objects or points are. In
physics
Physics is the natural science that studies matter, its fundamental constituents, its motion and behavior through space and time, and the related entities of energy and force. "Physical science is that department of knowledge which rel ...
or everyday usage, distance may refer to a physical
length or an estimation based on other criteria (e.g. "two counties over"). Since
spatial cognition is a rich source of
conceptual metaphors in
human thought, the term is also frequently used metaphorically to mean a measurement of the amount of difference between two similar objects (such as
statistical distance between
probability distributions or
edit distance between
strings of text) or a degree of separation (as exemplified by
distance between people in a
social network). Most such notions of distance, both physical and metaphorical, are formalized in
mathematics using the notion of a
metric space.
In the
social science
Social science is one of the branches of science, devoted to the study of societies and the relationships among individuals within those societies. The term was formerly used to refer to the field of sociology, the original "science of soc ...
s, distance can refer to a qualitative measurement of separation, such as
social distance or
psychological distance.
Distances in physics and geometry
The distance between physical locations can be defined in different ways in different contexts.
Straight-line or Euclidean distance
The distance between two points in physical
space
Space is the boundless three-dimensional extent in which objects and events have relative position and direction. In classical physics, physical space is often conceived in three linear dimensions, although modern physicists usually con ...
is the
length of a
straight line between them, which is the shortest possible path. This is the usual meaning of distance in
classical physics, including
Newtonian mechanics.
Straight-line distance is formalized mathematically as the
Euclidean distance in
two- and
three-dimensional space. In
Euclidean geometry
Euclidean geometry is a mathematical system attributed to ancient Greek mathematician Euclid, which he described in his textbook on geometry: the ''Elements''. Euclid's approach consists in assuming a small set of intuitively appealing axioms ...
, the distance between two points and is often denoted
. In
coordinate geometry, Euclidean distance is computed using the
Pythagorean theorem. The distance between points and in the plane is given by:
Similarly, given points (''x''
1, ''y''
1, ''z''
1) and (''x''
2, ''y''
2, ''z''
2) in three-dimensional space, the distance between them is:
This idea generalizes to higher-dimensional
Euclidean spaces.
Measurement
There are many ways of
measuring straight-line distances. For example, it can be done directly using a
ruler, or indirectly with a
radar
Radar is a detection system that uses radio waves to determine the distance ('' ranging''), angle, and radial velocity of objects relative to the site. It can be used to detect aircraft, ships, spacecraft, guided missiles, motor vehicles, w ...
(for long distances) or
interferometry (for very short distances). The
cosmic distance ladder is a set of ways of measuring extremely long distances.
Shortest-path distance on a curved surface

The straight-line distance between two points on the surface of the Earth is not very useful for most purposes, since we cannot tunnel straight through the
Earth's mantle. Instead, one typically measures the shortest path 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 surface ...
,
as the crow flies. This is approximated mathematically by the
great-circle distance on a sphere.
More generally, the shortest path between two points along a
curved surface
A surface, as the term is most generally used, is the outermost or uppermost layer of a physical object or space. It is the portion or region of the object that can first be perceived by an observer using the senses of sight and touch, and is ...
is known as a
geodesic. 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
...
of geodesics gives a way of measuring distance from the perspective of an
ant or other flightless creature living on that surface.
Effects of relativity
In the
theory of relativity, because of phenomena such as
length contraction and the
relativity of simultaneity, distances between objects depend on a choice of
inertial frame of reference. On galactic and larger scales, the measurement of distance is also affected by the
expansion of the universe. In practice, a number of
distance measures are used in
cosmology
Cosmology () is a branch of physics and metaphysics dealing with the nature of the universe. The term ''cosmology'' was first used in English in 1656 in Thomas Blount's ''Glossographia'', and in 1731 taken up in Latin by German philosophe ...
to quantify such distances.
Other spatial distances

Unusual definitions of distance can be helpful to model certain physical situations, but are also used in theoretical mathematics:
* In practice, one is often interested in the travel distance between two points along roads, rather than as the crow flies. In a
grid plan, the travel distance between street corners is given by the
Manhattan distance: the number of east–west and north–south blocks one must traverse to get between those two points.
* Chessboard distance, formalized as
Chebyshev distance, is the minimum number of moves a
king
King is the title given to a male monarch in a variety of contexts. The female equivalent is queen, which title is also given to the consort of a king.
*In the context of prehistory, antiquity and contemporary indigenous peoples, the ...
must make on a
chessboard in order to travel between two squares.
Metaphorical distances
Many abstract notions of distance used in mathematics, science and engineering represent a degree of difference or separation between similar objects. This page gives a few examples.
Statistical distances
In
statistics and
information geometry,
statistical distances measure the degree of difference between two
probability distributions. There are many kinds of statistical distances, typically formalized as
divergences; these allow a set of probability distributions to be understood as a
geometrical object called a
statistical manifold. The most elementary is the
squared Euclidean distance, which is minimized by the
least squares method; this is the most basic
Bregman divergence. The most important in
information theory is the
relative entropy (
Kullback–Leibler divergence), which allows one to analogously study
maximum likelihood estimation geometrically; this is an example of both an
''f''-divergence and a Bregman divergence (and in fact the only example which is both). Statistical manifolds corresponding to Bregman divergences are
flat manifolds in the corresponding geometry, allowing an analog of the
Pythagorean theorem (which holds for squared Euclidean distance) to be used for
linear inverse problems in inference by
optimization theory.
Other important statistical distances include the
Mahalanobis distance and the
energy distance.
Edit distances
In
computer science
Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to practical disciplines (includin ...
, an
edit distance or
string metric between two
strings measures how different they are. For example, the words "dog" and "dot", which differ by just one letter, are closer than "dog" and "cat", which have no letters in common. This idea is used in
spell checkers and in
coding theory, and is mathematically formalized in a number of different ways, including
Levenshtein distance,
Hamming distance,
Lee distance, and
Jaro–Winkler distance.
Distance in graph theory
In a
graph, the
distance between two vertices is measured by the length of the shortest
edge path between them. For example, if the graph represents a
social network, then the idea of
six degrees of separation can be interpreted mathematically as saying that the distance between any two vertices is at most six. Similarly, the
Erdős number and the
Bacon number—the number of collaborative relationships away a person is from prolific mathematician
Paul Erdős and actor
Kevin Bacon, respectively—are distances in the graphs whose edges represent mathematical or artistic collaborations.
In the social sciences
In
psychology
Psychology is the scientific study of mind and behavior. Psychology includes the study of conscious and unconscious phenomena, including feelings and thoughts. It is an academic discipline of immense scope, crossing the boundaries betwe ...
,
human geography, and the
social science
Social science is one of the branches of science, devoted to the study of societies and the relationships among individuals within those societies. The term was formerly used to refer to the field of sociology, the original "science of soc ...
s, distance is often theorized not as an objective numerical measurement, but as a qualitative description of a subjective experience. For example,
psychological distance is "the different ways in which an object might be removed from" the self along dimensions such as "time, space, social distance, and hypotheticality".
In
sociology
Sociology is a social science that focuses on society, human social behavior, patterns of social relationships, social interaction, and aspects of culture associated with everyday life. It uses various methods of empirical investigation and ...
,
social distance describes the separation between individuals or
social groups in
society
A society is a Social group, group of individuals involved in persistent Social relation, social interaction, or a large social group sharing the same spatial or social territory, typically subject to the same Politics, political authority an ...
along dimensions such as
social class,
race/
ethnicity,
gender
Gender is the range of characteristics pertaining to femininity and masculinity and differentiating between them. Depending on the context, this may include sex-based social structures (i.e. gender roles) and gender identity. Most cultures us ...
or
sexuality.
Mathematical formalization
Most of the notions of distance between two points or objects described above are examples of the mathematical idea of a
metric. A ''metric'' or ''distance function'' is a
function which takes pairs of points or objects to
real numbers and satisfies the following rules:
# The distance between an object and itself is always zero.
# The distance between distinct objects is always positive.
# Distance is
symmetric: the distance from to is always the same as the distance from to .
# Distance satisfies the
triangle inequality: if , , and are three objects, then
This condition can be described informally as "intermediate stops can't speed you up."
As an exception, many of the
divergences used in statistics are not metrics.
Distance between sets

There are multiple ways of measuring the physical distance between objects that
consist of more than one point:
* One may measure the distance between representative points such as the
center of mass; this is used for astronomical distances such as the
Earth–Moon distance.
* One may measure the distance between the closest points of the two objects; in this sense, the
altitude
Altitude or height (also sometimes known as depth) is a distance measurement, usually in the vertical or "up" direction, between a reference datum and a point or object. The exact definition and reference datum varies according to the context ...
of an airplane or spacecraft is its distance from the Earth. The same sense of distance is used in Euclidean geometry to define
distance from a point to a line,
distance from a point to a plane, or, more generally,
perpendicular distance between
affine subspaces.
: Even more generally, this idea can be used to define the distance between two
subsets of a metric space. The distance between sets and is the
infimum of the distances between any two of their respective points:
This does not define a metric on the set of such subsets: the distance between overlapping sets is zero, and this distance does not satisfy the triangle inequality for any metric space with two or more points (consider the triple of sets consisting of two distinct singletons and their union).
* The
Hausdorff distance between two subsets of a metric space can be thought of as measuring how far they are from perfectly overlapping. Somewhat more precisely, the Hausdorff distance between and is either the distance from to the farthest point of , or the distance from to the farthest point of , whichever is larger. (Here "farthest point" must be interpreted as a supremum.) The Hausdorff distance defines a metric on the set of
compact subsets of a metric space.
Related ideas
The word distance is also used for related concepts that are not encompassed by the description "a numerical measurement of how far apart points or objects are".
Distance travelled
The distance travelled by an object is the length of a specific path travelled between two points,
such as the distance walked while navigating a
maze. This can even be a closed distance along a
closed curve which starts and ends at the same point, such as a ball thrown straight up, or the Earth when it completes one
orbit. This is formalized mathematically as 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
...
of the curve.
The distance travelled may also be
signed: a "forward" distance is positive and a "backward" distance is negative.
Circular distance is the distance traveled by a point on the circumference of a
wheel, which can be useful to consider when designing vehicles or mechanical gears (see also
odometry). The circumference of the wheel is ; if the radius is 1, each revolution of the wheel causes a vehicle to travel radians.
Displacement and directed distance

The
displacement in classical physics measures the change in position of an object during an interval of time. While distance is a
scalar quantity, or a
magnitude, displacement is a
vector quantity with both magnitude and
direction. In general, the vector measuring the difference between two locations (the
relative position
In geometry, a position or position vector, also known as location vector or radius vector, is a Euclidean vector that represents the position of a point ''P'' in space in relation to an arbitrary reference origin ''O''. Usually denoted x, r, or ...
) is sometimes called the directed distance.
For example, the directed distance from the
New York City Main Library flag pole to the
Statue of Liberty flag pole has:
* A starting point: library flag pole
* An ending point: statue flag pole
* A direction: -38°
* A distance: 8.72 km
Signed distance
See also
*
Absolute difference
*
Astronomical system of units
*
Color difference
*
Closeness (mathematics)
*
Distance geometry problem Distance geometry is the branch of mathematics concerned with characterizing and studying sets of points based ''only'' on given values of the distances between pairs of points. More abstractly, it is the study of semimetric spaces and the isom ...
*
Dijkstra's algorithm
*
Distance matrix
In mathematics, computer science and especially graph theory, a distance matrix is a square matrix
In mathematics, a square matrix is a matrix with the same number of rows and columns. An ''n''-by-''n'' matrix is known as a square matrix of orde ...
*
Distance set
*
Engineering tolerance
*
Multiplicative distance
*
Optical path length
*
Orders of magnitude (length)
*
Proper length
*
Proxemics – physical distance between people
*
Signed distance function
*
Similarity measure
*
Social distancing
*
Vertical distance
Library support
*
Python (programming language)
Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.
Python is dynamically-typed and garbage-collected. It supports multiple programming pa ...
*
Interspace-A package for finding the distance between two vectors, numbers and strings.
*
-Distance computations (
scipy.spatial.distance
)
*
Julia (programming language)
Julia Statistics Distance-A Julia package for evaluating distances (metrics) between vectors.
References
Bibliography
*
{{Authority control