Distance is a numerical or occasionally qualitative measurement of how far apart objects, points, people, or ideas are.
The term is also frequently used metaphorically[1] 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).
The distance between two points in physical space 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.
In coordinate geometry, Euclidean distance is computed using the Pythagorean theorem.
Instead, one typically measures the shortest path along the surface of the Earth, as the crow flies.
More generally, the shortest path between two points along a curved surface is known as a geodesic.
The arc length of geodesics gives a way of measuring distance from the perspective of an ant or other flightless creature living on that surface.
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.
Unusual definitions of distance can be helpful to model certain physical situations, but are also used in theoretical mathematics: Many abstract notions of distance used in mathematics, science and engineering represent a degree of difference or separation between similar objects.
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 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.
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 psychology, human geography, and the social sciences, distance is often theorized not as an objective numerical measurement, but as a qualitative description of a subjective experience.
[4] 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".
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 d which takes pairs of points or objects to real numbers and satisfies the following rules: As an exception, many of the divergences used in statistics are not metrics.
There are multiple ways of measuring the physical distance between objects that consist of more than one point: 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".
The displacement in classical physics measures the change in position of an object during an interval of time.
In general, the vector measuring the difference between two locations (the relative position) is sometimes called the directed distance.
[7] For example, the directed distance from the New York City Main Library flag pole to the Statue of Liberty flag pole has: