Distance is a numerical or occasionally qualitative

_{1}, ''y''_{1}, ''z''_{1}) and (''x''_{2}, ''y''_{2}, ''z''_{2}) in three-dimensional space, the distance between them is:
$$d=\backslash sqrt=\backslash sqrt.$$
This idea generalizes to higher-dimensional

Interspace

-A package for finding the distance between two vectors, numbers and strings. *

-Distance computations (

Julia Statistics Distance

-A Julia package for evaluating distances (metrics) between vectors.

measurement
Measurement is the quantification of attributes of an object or event, which can be used to compare with other objects or events.
In other words, measurement is a process of determining how large or small a physical quantity is as compared ...

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 ...

or everyday usage, distance may refer to a physical length
Length is a measure of distance. In the International System of Quantities, length is a quantity with dimension distance. In most systems of measurement a base unit for length is chosen, from which all other units are derived. In the I ...

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 distribution
In probability theory
Probability theory is the branch of mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and qua ...

s or edit distance between strings of text) or a degree of separation (as exemplified by distance between people in a social network
A social network is a social structure
In the social sciences, social structure is the aggregate of patterned social arrangements in society that are both emergent from and determinant of the actions of individuals. Likewise, society i ...

). Most such notions of distance, both physical and metaphorical, are formalized in mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...

using the notion of a metric space
In mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in m ...

.
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
Sociology is a social ...

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 physicalspace
Space is the boundless three-dimensional extent in which objects and events have relative position and direction. In classical physics
Classical physics is a group of physics
Physics is the natural science that studies matte ...

is the length
Length is a measure of distance. In the International System of Quantities, length is a quantity with dimension distance. In most systems of measurement a base unit for length is chosen, from which all other units are derived. In the I ...

of a straight line
In geometry
Geometry (; ) is, with arithmetic, one of the oldest branches of mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they ...

between them, which is the shortest possible path. This is the usual meaning of distance in classical physics
Classical physics is a group of 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 sci ...

, including Newtonian mechanics
Newton's laws of motion are three basic laws of classical mechanics
Classical mechanics is a physical theory describing the motion of macroscopic objects, from projectiles to parts of machinery, and astronomical objects, such ...

.
Straight-line distance is formalized mathematically as the Euclidean distance
In mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented i ...

in two- and three-dimensional space
Three-dimensional space (also: 3D space, 3-space or, rarely, tri-dimensional space) is a geometric setting in which three values (called ''parameter
A parameter (), generally, is any characteristic that can help in defining or classifying ...

. In Euclidean geometry
Euclidean geometry is a mathematical system attributed to ancient Greek mathematician Euclid, which he described in his textbook on geometry
Geometry (; ) is, with arithmetic, one of the oldest branches of mathematics
Mathematics ...

, the distance between two points and is often denoted $,\; AB,$. In coordinate geometry
In classical mathematics In the foundations of mathematics, classical mathematics refers generally to the mainstream approach to mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related str ...

, Euclidean distance is computed using the Pythagorean theorem
In mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented i ...

. The distance between points and in the plane is given by:
$$d=\backslash sqrt=\backslash sqrt.$$
Similarly, given points (''x''Euclidean space
Euclidean space is the fundamental space of geometry
Geometry (; ) is, with arithmetic, one of the oldest branches of mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structure ...

s.
Measurement

There are many ways of measuring straight-line distances. For example, it can be done directly using aruler
A ruler, sometimes called a rule, line gauge, or scale, is a device used in geometry
Geometry (; ) is, with arithmetic, one of the oldest branches of mathematics
Mathematics is an area of knowledge that includes the topics of ...

, 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
A spacecraft is a vehicle ...

(for long distances) or interferometry
Interferometry is a technique which uses the '' interference'' of superimposed waves to extract information. Interferometry typically uses electromagnetic waves and is an important investigative technique in the fields of astronomy
A ...

(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 theEarth's mantle
Earth's mantle is a layer of silicate rock between the crust and the outer core
Earth's outer core is a fluid layer about thick, composed of mostly iron
Iron () is a chemical element
A chemical element is a species of atoms t ...

. Instead, one typically measures the shortest path along the surface of the Earth, 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 is known as a geodesic
In geometry
Geometry (; ) is, with arithmetic, one of the oldest branches of mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they a ...

. 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 thetheory of relativity
The theory of relativity usually encompasses two interrelated theories by Albert Einstein
Albert Einstein ( ; ; 14 March 1879 – 18 April 1955) was a German-born theoretical physicist, widely acknowledged to be one of the greates ...

, because of phenomena such as length contraction
Length contraction is the phenomenon that a moving object's length is measured to be shorter than its proper length, which is the length as measured in the object's own rest frame. It is also known as Lorentz contraction or Lorentz–FitzGera ...

and the relativity of simultaneity
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 ...

, 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
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 sci ...

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 agrid plan
In urban planning, the grid plan, grid street plan, or gridiron plan is a type of city plan in which streets run at right angles to each other, forming a grid.
Two inherent characteristics of the grid plan, frequent intersections and orth ...

, 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
In mathematics, Chebyshev distance (or Tchebychev distance), maximum metric, or L∞ metric is a Metric (mathematics), metric defined on a vector space where the distance between two coordinate vector, vectors is the greatest of their differences ...

, 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

Instatistics
Statistics (from German: '' Statistik'', "description of a state, a country") is the discipline that concerns the collection, organization, analysis, interpretation, and presentation of data. In applying statistics to a scientific, indus ...

and information geometry, statistical distances measure the degree of difference between two probability distribution
In probability theory
Probability theory is the branch of mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and qua ...

s. 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
The method of least squares is a standard approach in regression analysis to approximate the solution of overdetermined systems (sets of equations in which there are more equations than unknowns) by minimizing the sum of the squares of the r ...

method; this is the most basic Bregman divergence. The most important in information theory
Information theory is the scientific study of the quantification, storage, and communication of information. The field was originally established by the works of Harry Nyquist and Ralph Hartley, in the 1920s, and Claude Shannon in the 194 ...

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
In mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented i ...

(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

Incomputer 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 (inclu ...

, 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 checker In software
Software is a set of computer programs and associated documentation and data. This is in contrast to hardware, from which the system is built and which actually performs the work.
At the lowest programming level, executable ...

s and in coding theory, and is mathematically formalized in a number of different ways, including Levenshtein distance
In information theory
Information theory is the scientific study of the quantification, storage, and communication of information. The field was originally established by the works of Harry Nyquist and Ralph Hartley, in the 1920s, and Cl ...

, Hamming distance, Lee distance, and Jaro–Winkler distance.
Distance in graph theory

In agraph
Graph may refer to:
Mathematics
* Graph (discrete mathematics), a structure made of vertices and edges
**Graph theory
In mathematics, graph theory is the study of ''graph (discrete mathematics), graphs'', which are mathematical structures us ...

, 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
A social network is a social structure
In the social sciences, social structure is the aggregate of patterned social arrangements in society that are both emergent from and determinant of the actions of individuals. Likewise, society i ...

, then the idea of six degrees of separation
Six degrees of separation is the idea that all people are six or fewer social connections away from each other. As a result, a chain of " friend of a friend" statements can be made to connect any two people in a maximum of six steps. It is also ...

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
Kevin Norwood Bacon (born July 8, 1958) is an American actor. His films include the musical-drama film ''Footloose (1984 film), Footloose'' (1984), the controversial historical conspiracy legal thriller ''JFK (film), JFK'' (1991), the legal dr ...

, respectively—are distances in the graphs whose edges represent mathematical or artistic collaborations.
In the social sciences

Inpsychology
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 be ...

, human geography
Human geography or anthropogeography is the branch of geography
Geography (from Greek: , ''geographia''. Combination of Greek words ‘Geo’ (The Earth) and ‘Graphien’ (to describe), literally "earth description") is a field of s ...

, 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
Sociology is a social ...

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 Interpersonal ties, social relationships, social interaction, and aspects of culture associated with everyday life. It uses various methods of Empirical ...

, social distance describes the separation between individuals or social groups in society
A society is a group of individuals involved in persistent social interaction, or a large social group
In the social sciences, a social group can be defined as two or more people who interact with one another, share similar characte ...

along dimensions such as social class
A social class is a grouping of people into a set of hierarchical social categories, the most common being the upper, middle and lower classes. Membership in a social class can for example be dependent on education, wealth, occupation, inc ...

, race/ethnicity
An ethnic group or an ethnicity is a grouping of people
A person ( : people) is a being that has certain capacities or attributes such as reason, morality, consciousness or self-consciousness, and being a part of a culturally established ...

, 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
Human sexuality is the way people experience and express themselves sexually. This involves biological
Biology is the scientific study of life
Life is a quality that distinguishes matter that has biological processes, suc ...

.
Mathematical formalization

Most of the notions of distance between two points or objects described above are examples of the mathematical idea of ametric
Metric or metrical may refer to:
* Metric system
The metric system is a system of measurement that succeeded the decimalised system based on the metre that had been introduced in France in the 1790s. The historical development of these s ...

. A ''metric'' or ''distance function'' is a function which takes pairs of points or objects to real numbers
In mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in ...

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 $$d(x,z)\; \backslash leq\; d(x,y)+d(y,z).$$ 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 thecenter of mass
In physics, the center of mass of a distribution of mass in space (sometimes referred to as the balance point) is the unique point where the weighted relative position of the distributed mass sums to zero. This is the point to which a force m ...

; 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 In Euclidean geometry
Euclidean geometry is a mathematical system attributed to ancient Greek mathematician Euclid, which he described in his textbook on geometry
Geometry (; ) is, with arithmetic, one of the oldest branches of mathemat ...

, 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 subset
In mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented i ...

s of a metric space. The distance between sets and is the infimum
In mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in ...

of the distances between any two of their respective points:$$d(A,B)=\backslash inf\_\; d(x,y).$$ 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 amaze
A maze is a path or collection of paths, typically from an entrance to a goal. The word is used to refer both to branching tour puzzles through which the solver must find a route, and to simpler non-branching ("unicursal") patterns that le ...

. This can even be a closed distance along a closed curve
In mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in ...

which starts and ends at the same point, such as a ball thrown straight up, or the Earth when it completes one orbit
In celestial mechanics, an orbit is the curved trajectory of an object such as the trajectory of a planet around a star, or of a natural satellite around a planet, or of an artificial satellite around an object or position in space such ...

. 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
A wheel is a circular component that is intended to rotate on an axle
An axle or axletree is a central shaft for a rotating wheel or gear. On wheeled vehicles, the axle may be fixed to the wheels, rotating with them, or fixed to the v ...

, 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 avector
Vector most often refers to:
* Euclidean vector, a quantity with a magnitude and a direction
* Vector (epidemiology), an agent that carries and transmits an infectious pathogen into another living organism
Vector may also refer to:
Mathemat ...

quantity with both magnitude and direction. In general, the vector measuring the difference between two locations (the relative position) 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
The Statue of Liberty (''Liberty Enlightening the World''; French: ''La Liberté éclairant le monde'') is a colossal neoclassical sculpture on Liberty Island in New York Harbor in New York City, in the United States
The United ...

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
The absolute difference of two real numbers x and y is given by , x-y, , the absolute value of their difference. It describes the distance on the real line between the points corresponding to x and y. It is a special case of the Lp distance f ...

* Astronomical system of units
* Color difference
* Closeness (mathematics)
* Distance geometry problem
*Dijkstra's algorithm
Dijkstra's algorithm ( ) is an algorithm
In mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantiti ...

*Distance matrix
In mathematics
Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in mo ...

* Distance set
*Engineering tolerance
Engineering tolerance is the permissible limit or limits of variation in:
# a physical dimension;
# a measured value or physical property of a material, manufactured object, system, or service;
# other measured values (such as temperature, ...

* Multiplicative distance
* Optical path length
* Orders of magnitude (length)
* Proper length
* Proxemics – physical distance between people
* Signed distance function
* Similarity measure
*Social distancing
In public health, social distancing, also called physical distancing, (NB. Regula Venske is president of the PEN Centre Germany.) is a set of non-pharmaceutical interventions or measures intended to prevent the spread of a contagious dis ...

* 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 p ...

*Interspace

-A package for finding the distance between two vectors, numbers and strings. *

-Distance computations (

`scipy.spatial.distance`

)
*Julia (programming language)
Julia is a high-level, dynamic programming language
A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a ki ...

Julia Statistics Distance

-A Julia package for evaluating distances (metrics) between vectors.

References

Bibliography

* {{Authority control