Distance is a numerical

_{1}, ''y''_{1}) and (''x''_{2}, ''y''_{2}) is given by:
:$d=\backslash sqrt=\backslash sqrt.$
Similarly, given points (''x''_{1}, ''y''_{1}, ''z''_{1}) and (''x''_{2}, ''y''_{2}, ''z''_{2}) in three-space, the distance between them is:
:$d=\backslash sqrt=\backslash sqrt.$
These formula are easily derived by constructing a right triangle with a leg on the

^{n}, the distance between two points is usually given by the _{1}, ''x''_{2}, ...,''x''_{''n''}) and a point (''y''_{1}, ''y''_{2}, ...,''y''_{''n''}), the Euclidean distance
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). ...

, a generalization of the

http://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/FISHER/CIRCLEFIT/fit2dcircle/node3.html] For curves or surfaces given by the equation $x^\backslash text\; C\; x=0$ (such as a Conic#Homogeneous coordinates, conic in homogeneous coordinates), the algebraic distance from the point $x\text{'}$ to the curve is simply $x\text{'}^\backslash text\; C\; x\text{'}$. It may serve as an "initial guess" for geometric distance to refine estimations of the curve by more accurate methods, such as

metric space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...

.
*The Hausdorff distance is the larger of two values, one being the supremum, for a point ranging over one set, of the infimum, for a second point ranging over the other set, of the distance between the points, and the other value being likewise defined but with the roles of the two sets swapped. This distance makes the set of non-empty compact space, compact subsets of a metric space itself a metric space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...

.
The Metric space#Distance between points and sets; Hausdorff distance and Gromov metric, distance between a point and a set is the infimum of the distances between the point and those in the set. This corresponds to the distance, according to the first-mentioned definition above of the distance between sets, from the set containing only this point to the other set.
In terms of this, the definition of the Hausdorff distance can be simplified: it is the larger of two values, one being the supremum, for a point ranging over one set, of the distance between the point and the set, and the other value being likewise defined but with the roles of the two sets swapped.

Interspace

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

-Distance computations (

Julia Statistics Distance

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

measurement
Measurement is the quantification (science), quantification of variable and attribute (research), attributes of an object or event, which can be used to compare with other objects or events. The scope and application of measurement are dependen ...

of how far apart objects or points are. In physics
Physics is the natural science that studies matter, its Elementary particle, fundamental constituents, its Motion (physics), motion and behavior through Spacetime, space and time, and the related entities of energy and force. "Physical scie ...

or everyday usage, distance may refer to a physical length
Length is a measure of distance
Distance is a numerical measurement
'
Measurement is the number, numerical quantification (science), quantification of the variable and attribute (research), attributes of an object or event, which can be us ...

or an estimation based on other criteria (e.g. "two counties over"). The distance from a point A to a point B is sometimes denoted as $,\; AB,$. In most cases, "distance from A to B" is interchangeable with "distance from B to A". In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and their changes (cal ...

, a distance function or metric
METRIC (Mapping EvapoTranspiration at high Resolution with Internalized Calibration) is a computer model
Computer simulation is the process of mathematical modelling, performed on a computer, which is designed to predict the behaviour of or th ...

is a generalization of the concept of physical distance; it is a way of describing what it means for elements of some space to be "close to", or "far away from" each other.
In psychology
Psychology is the scientific
Science () is a systematic enterprise that builds and organizes knowledge
Knowledge is a familiarity or awareness, of someone or something, such as facts
A fact is an occurrence in the real world. ...

and social science
Social science is the branch
A branch ( or , ) or tree branch (sometimes referred to in botany
Botany, also called , plant biology or phytology, is the science of plant life and a branch of biology. A botanist, plant scientist o ...

s, distance is a non-numerical measurement; Psychological distance is defined as "the different ways in which an object might be removed from" the self along dimensions such as "time, space, social distance, and hypotheticality.
Overview and definitions

Physical distances

A physical distance can mean several different things: * Distance traveled: The length of a specific path traveled between two points, such as the distance walked while navigating a maze * Straight-line (Euclidean) distance: The length of the shortest possible path through space, between two points, that could be taken if there were no obstacles (usually formalized asEuclidean distance
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). ...

)
* Geodesic distance: The length of the shortest path between two points while remaining on some surface, such as the great-circle distance
The great-circle distance, orthodromic distance, or spherical distance is the shortest distance between two points on the surface of a sphere
of a sphere
A sphere (from Greek language, Greek —, "globe, ball") is a Geometry, geometrical ob ...

along the curve of the Earth
* The length of a specific path that returns to the starting 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 physical body, object such as the trajectory of a planet around a star, or of a natural satellite around a planet, or of an satellite, artificial satellite around an object or po ...

.
"Circular distance" is the distance traveled by a wheel, which can be useful when designing vehicles or mechanical gears. The circumference of the wheel is 2''π'' × radius, and assuming the radius to be 1, then each revolution of the wheel is equivalent of the distance 2''π'' radians. In engineering ''ω'' = 2''πƒ'' is often used, where ''ƒ'' is the frequency
Frequency is the number of occurrences of a repeating event per unit of time
A unit of time is any particular time
Time is the indefinite continued sequence, progress of existence and event (philosophy), events that occur in an apparen ...

.
Unusual definitions of distance can be helpful to model certain physical situations, but are also used in theoretical mathematics:
* "Manhattan distance
A taxicab geometry is a form of geometry in which the usual distance function or Metric (mathematics), metric of Euclidean geometry is replaced by a new metric in which the distance between two points is the sum of the absolute differences of thei ...

" is a rectilinear distance, named after the number of blocks (in the north, south, east or west directions) a taxicab must travel on, in order to reach its destination on the grid of streets in parts of New York City.
* "Chessboard distance", formalized as Chebyshev distance
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and ...

, is the minimum number of moves a king must make on a chessboard
A chessboard is the type of used for the game of chess, on which the chess Pawn (chess), pawns and are placed. A chessboard is usually square in shape, with an alternating pattern of squares in two colours. Though usually played on a surface, a t ...

, in order to travel between two squares.
Distance measures in cosmology
Distance measures are used in physical cosmology to give a natural notion of the distance between two objects or events in the universe. They are often used to tie some ''observable'' quantity (such as the luminosity of a distant quasar, the redsh ...

are complicated by the expansion of the universe
The expansion of the universe is the increase in distance between any two given gravitationally unbound parts of the observable universe with time. It is an intrinsic expansion whereby ''the scale of space itself changes''. The universe does n ...

, and by effects described by the theory 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 , widely acknowledged to be one of the greatest physicists of all time ...

(such as length contraction
Length contraction is the phenomenon that a moving object's length is measured to be shorter than its proper length
Proper length or rest length is the length of an object in the object's rest frame.
The measurement of lengths is more compl ...

of moving objects).
Theoretical distances

The term "distance" is also used by analogy to measure non-physical entities in certain ways. Incomputer science
Computer science deals with the theoretical foundations of information, algorithms and the architectures of its computation as well as practical techniques for their application.
Computer science is the study of computation, automation, a ...

, there is the notion of the "edit distance
In computational linguistics and computer science, edit distance is a way of quantifying how dissimilar two String (computing), strings (e.g., words) are to one another by counting the minimum number of operations required to transform one string in ...

" between two strings. For example, the words "dog" and "dot", which vary by only one letter, are closer than "dog" and "cat", which differ by three letters. This idea is used in spell checkerIn software
Software is a collection of instructions that tell a computer
A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically. Modern computers can perform generic sets ...

s and in coding theory
Coding theory is the study of the properties of codes and their respective fitness for specific applications. Codes are used for data compression, cryptography, error detection and correction, data transmission and data storage. Codes are studied ...

, and is mathematically formalized in several different ways such as:
* Levenshtein distance
In information theory
Information theory is the scientific study of the quantification, storage, and communication
Communication (from Latin ''communicare'', meaning "to share") is the act of developing Semantics, meaning among Subject (phi ...

* Hamming distance
In information theory
Information theory is the scientific study of the quantification, storage, and communication
Communication (from Latin ''communicare'', meaning "to share" or "to be in relation with") is "an apparent answer to ...

* Lee distanceIn coding theory
Coding theory is the study of the properties of codes and their respective fitness for specific applications. Codes are used for data compression
In signal processing, data compression, source coding, or bit-rate reduction is t ...

* Jaro–Winkler distance
In computer science and statistics, the Jaro–Winkler distance is a string metric measuring an edit distance between two sequences. It is a variant proposed in 1990 by William E. Winkler of the Jaro distance metric (1989, Matthew A. Jaro).
The Ja ...

In mathematics, a metric space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...

is a set for which distances between all members of the set are defined. In this way, many different types of "distances" can be calculated, such as for traversal of graphs, comparison of distributions and curves, and using unusual definitions of "space" (for example using a manifold
The real projective plane is a two-dimensional manifold that cannot be realized in three dimensions without self-intersection, shown here as Boy's surface.
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of su ...

or reflections). The notion of distance in graph theory has been used to describe social network
A social network is a social structure made up of a set of social actors (such as individuals or organizations), sets of Dyad (sociology), dyadic ties, and other Social relation, social interactions between actors. The social network perspectiv ...

s, for example with the Erdős number or the Bacon number—the number of collaborative relationships away a person is from prolific mathematician Paul Erdős
Paul Erdős ( hu, Erdős Pál ; 26 March 1913 – 20 September 1996) was a renowned Hungarian mathematician
In this page we keep the names in Hungarian order (family name first).
{{compact ToC , short1, side=yes
A
* Alexits György (1899–1 ...

and actor Kevin Bacon
Kevin Norwood Bacon (born July 8, 1958) is an American actor. His films include the musical-drama film '' Footloose'' (1984), the controversial historical conspiracy legal thriller '' JFK'' (1991), the legal drama ''A Few Good Men
''A Few ...

, respectively.
In psychology, human geography, and the social sciences, distance is often theorized not as an objective metric, but as a subjective experience.
Distance versus directed distance and displacement

Both distance and displacement measure the movement of an object. Distance cannot be negative, and never decreases. Distance is ascalar
Scalar may refer to:
*Scalar (mathematics), an element of a field, which is used to define a vector space, usually the field of real numbers
*Scalar (physics), a physical quantity that can be described by a single element of a number field such as ...

quantity, or a magnitude
Magnitude may refer to:
Mathematics
*Euclidean vector, a quantity defined by both its magnitude and its direction
*Magnitude (mathematics), the relative size of an object
*Norm (mathematics), a term for the size or length of a vector
*Order of ...

, whereas displacement
Displacement may refer to:
Physical sciences
Mathematics and Physics
*Displacement (geometry), is the difference between the final and initial position of a point trajectory (for instance, the center of mass of a moving object). The actual path c ...

is a vector
Vector may refer to:
Biology
*Vector (epidemiology)
In epidemiology
Epidemiology is the study and analysis of the distribution (who, when, and where), patterns and risk factor, determinants of health and disease conditions in defined pop ...

quantity with both magnitude and direction
Direction may refer to:
*Relative direction, for instance left, right, forward, backwards, up, and down
** Anatomical terms of location for those used in anatomy
*Cardinal direction
Mathematics and science
*Direction vector, a unit vector that ...

. It can be negative, zero, or positive. Directed distance does not measure movement; it measures the separation of two points, and can be a positive, zero, or negative vector.
The distance covered by a vehicle (for example as recorded by an odometer
An odometer or odograph is an instrument used for measuring the distance traveled by a vehicle, such as a bicycle or car. The device may be electronic, mechanical, or a combination of the two (electromechanical). The noun derives from ancient Gr ...

), person, animal, or object along a curved path from a point ''A'' to a point ''B'' should be distinguished from the straight-line distance from ''A'' to ''B''. For example, whatever the distance covered during a round trip from ''A'' to ''B'' and back to ''A'', the displacement is zero as start and end points coincide. In general the straight-line distance does not equal distance travelled, except for journeys in a straight line.
Directed distance

Directed distances can be determined along straight lines and along curved lines. Directed distances along straight lines are vectors that give the distance and direction between a starting point and an ending point. A directed distance of a point ''C'' from point ''A'' in the direction of ''B'' on a line ''AB'' in aEuclidean vector space
Euclidean space is the fundamental space of classical geometry. Originally, it was the three-dimensional space
Three-dimensional space (also: 3-space or, rarely, tri-dimensional space) is a geometric setting in which three values (called ...

is the distance from ''A'' to ''C'' if ''C'' falls on the ray ''AB'', but is the negative of that distance if ''C'' falls on the ray ''BA'' (i.e., if ''C'' is not on the same side of ''A'' as ''B'' is). 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
Another kind of directed distance is that between two different particles or point masses at a given time. For instance, the distance from the center of gravity
In physics, the center of mass of a distribution of mass
Mass is the physical quantity, quantity of ''matter'' in a physical body. It is also a measure (mathematics), measure of the body's ''inertia'', the resistance to acceleration (change ...

of the Earth ''A'' and the center of gravity of the Moon ''B'' (which does not strictly imply motion from ''A'' to ''B'') falls into this category.
A directed distance along a curved line is not a vector and is represented by a segment of that curved line defined by endpoints ''A'' and ''B'', with some specific information indicating the sense (or direction) of an ideal or real motion from one endpoint of the segment to the other (see figure). For instance, just labelling the two endpoints as ''A'' and ''B'' can indicate the sense, if the ordered sequence (''A'', ''B'') is assumed, which implies that ''A'' is the starting point.
Displacement

A displacement (see above) is a special kind of directed distance defined inmechanics
Mechanics (Greek#REDIRECT Greek
Greek may refer to:
Greece
Anything of, from, or related to Greece
Greece ( el, Ελλάδα, , ), officially the Hellenic Republic, is a country located in Southeast Europe. Its population is approximat ...

. A directed distance is called displacement when it is the distance along a straight line (minimum distance) from ''A'' and ''B'', and when ''A'' and ''B'' are positions occupied by the ''same particle'' at two ''different instants'' of time. This implies motion
Image:Leaving Yongsan Station.jpg, 300px, Motion involves a change in position
In physics, motion is the phenomenon in which an object changes its position (mathematics), position over time. Motion is mathematically described in terms of Displacem ...

of the particle. The distance traveled by a particle must always be greater than or equal to its displacement, with equality occurring only when the particle moves along a straight path.
Mathematics

Geometry

Inanalytic geometry
In classical mathematics, analytic geometry, also known as coordinate geometry or Cartesian geometry, is the study of geometry
Geometry (from the grc, γεωμετρία; ' "earth", ' "measurement") is, with , one of the oldest branches ...

, the Euclidean distance
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). ...

between two points of the xy-plane can be found using the distance formula. The distance between (''x''hypotenuse
In geometry
Geometry (from the grc, γεωμετρία; ' "earth", ' "measurement") is, with , one of the oldest branches of . It is concerned with properties of space that are related with distance, shape, size, and relative position of ...

of another (with the other leg orthogonal
In mathematics, orthogonality is the generalization of the notion of perpendicularity to the linear algebra of bilinear forms. Two elements ''u'' and ''v'' of a vector space with bilinear form ''B'' are orthogonal when . Depending on the bili ...

to the plane
Plane or planes may refer to:
* Airplane
An airplane or aeroplane (informally plane) is a fixed-wing aircraft
A fixed-wing aircraft is a heavier-than-air flying machine
Early flying machines include all forms of aircraft studied ...

that contains the 1st triangle) and applying the Pythagorean theorem
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no ...

. This distance formula
In , a formula is a concise way of expressing information symbolically, as in a mathematical formula or a . The informal use of the term ''formula'' in science refers to the .
The plural of ''formula'' can be either ''formulas'' (from the mos ...

can also be expanded into the . Other distances with other formulas are used in non-Euclidean geometry
In mathematics, non-Euclidean geometry consists of two geometries based on axioms closely related to those that specify Euclidean geometry. As Euclidean geometry lies at the intersection of metric geometry and affine geometry, non-Euclidean geome ...

.
Distance in Euclidean space

In theEuclidean space
Euclidean space is the fundamental space of classical geometry. Originally, it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are Euclidean spaces of any nonnegative integer dimension (mathematics), dimens ...

REuclidean distance
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). ...

(2-norm distance). Other distances, based on other norms
Norm, the Norm or NORM may refer to:
In academic disciplines
* Norm (geology), an estimate of the idealised mineral content of a rock
* Norm (philosophy), a standard in normative ethics that is prescriptive rather than a descriptive or explanato ...

, are sometimes used instead.
For a point (''x''Minkowski distance
The Minkowski distance or Minkowski metric is a metric
METRIC (Mapping EvapoTranspiration at high Resolution with Internalized Calibration) is a computer model
Computer simulation is the process of mathematical modelling, performed on a comp ...

of order ''p'' (''p''-norm distance) is defined as:
''p'' need not be an integer, but it cannot be less than 1, because otherwise the triangle inequality
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities an ...

does not hold.
The 2-norm distance is the Pythagorean theorem
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no ...

to more than two coordinates
In geometry
Geometry (from the grc, γεωμετρία; ''wikt:γῆ, geo-'' "earth", ''wikt:μέτρον, -metron'' "measurement") is, with arithmetic, one of the oldest branches of mathematics. It is concerned with properties of space t ...

. It is what would be obtained if the distance between two points were measured with a ruler
A ruler, sometimes called a rule or line gauge, is a device used in geometry
Geometry (from the grc, γεωμετρία; ' "earth", ' "measurement") is, with , one of the oldest branches of . It is concerned with properties of spac ...

: the "intuitive" idea of distance.
The 1-norm distance is more colourfully called the ''taxicab norm'' or ''Manhattan distance
A taxicab geometry is a form of geometry in which the usual distance function or Metric (mathematics), metric of Euclidean geometry is replaced by a new metric in which the distance between two points is the sum of the absolute differences of thei ...

'', because it is the distance a car would drive in a city laid out in square blocks (if there are no one-way streets).
The infinity norm distance is also called Chebyshev distance
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and ...

. In 2D, it is the minimum number of moves king
King is the title given to a male monarch in a variety of contexts. The female equivalent is queen regnant, queen, which title is also given to the queen consort, consort of a king.
*In the context of prehistory, antiquity and contempora ...

s require to travel between two squares on a chessboard
A chessboard is the type of used for the game of chess, on which the chess Pawn (chess), pawns and are placed. A chessboard is usually square in shape, with an alternating pattern of squares in two colours. Though usually played on a surface, a t ...

.
The ''p''-norm is rarely used for values of ''p'' other than 1, 2, and infinity, but see super ellipse
A superellipse, also known as a Lamé curve after Gabriel Lamé
Gabriel Lamé (22 July 1795 – 1 May 1870) was a French mathematician who contributed to the theory of partial differential equation
In mathematics
Mathematics (from Ancie ...

.
In physical space the Euclidean distance is in a way the most natural one, because in this case the length of a rigid body
In physics
Physics is the natural science that studies matter, its Elementary particle, fundamental constituents, its Motion (physics), motion and behavior through Spacetime, space and time, and the related entities of energy and force. " ...

does not change with rotation
A rotation is a circular movement of an object around a center (or point) of rotation. The plane (geometry), geometric plane along which the rotation occurs is called the ''rotation plane'', and the imaginary line extending from the center an ...

.
Variational formulation of distance

The Euclidean distance between two points in space ($A\; =\; \backslash vec(0)$ and $B\; =\; \backslash vec(T)$) may be written in a variational form where the distance is the minimum value of an integral: : $D\; =\; \backslash int\_0^T\; \backslash sqrt\; \backslash ,\; dt$ Here $\backslash vec(t)$ is the trajectory (path) between the two points. The value of the integral (D) represents the length of this trajectory. The distance is the minimal value of this integral and is obtained when $r\; =\; r^$ where $r^$ is the optimal trajectory. In the familiar Euclidean case (the above integral) this optimal trajectory is simply a straight line. It is well known that the shortest path between two points is a straight line. Straight lines can formally be obtained by solving the Euler–Lagrange equations for the abovefunctional
Functional may refer to:
* Movements in architecture:
** Functionalism (architecture)
In architecture
File:Plan d'exécution du second étage de l'hôtel de Brionne (dessin) De Cotte 2503c – Gallica 2011 (adjusted).jpg, upright=1.45, alt=Pl ...

. In non-Euclidean manifolds (curved spaces) where the nature of the space is represented by a metric tensor
In the mathematical
Mathematics (from Greek
Greek may refer to:
Greece
Anything of, from, or related to Greece
Greece ( el, Ελλάδα, , ), officially the Hellenic Republic, is a country located in Southeast Europe. Its population ...

$g\_$ the integrand has to be modified to $\backslash sqrt$, where Einstein summation convention
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). It ...

has been used.
Generalization to higher-dimensional objects

The Euclidean distance between two objects may also be generalized to the case where the objects are no longer points but are higher-dimensionalmanifolds
The real projective plane is a two-dimensional manifold that cannot be realized in three dimensions without self-intersection, shown here as Boy's surface.
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of suc ...

, such as space curves, so in addition to talking about distance between two points one can discuss concepts of distance between two strings. Since the new objects that are dealt with are extended objects (not points anymore) additional concepts such as non-extensibility, curvature
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities an ...

constraints, and non-local interactions that enforce non-crossing become central to the notion of distance. The distance between the two manifolds is the scalar quantity that results from minimizing the generalized distance functional, which represents a transformation between the two manifolds:
: $\backslash mathcal\; =\; \backslash int\_0^L\backslash int\_0^T\; \backslash left\; \backslash \; \backslash ,\; ds\; \backslash ,\; dt$
The above double integral is the generalized distance functional between two polymer conformation. $s$ is a spatial parameter and $t$ is pseudo-time. This means that $\backslash vec(s,t=t\_i)$ is the polymer/string conformation at time $t\_i$ and is parameterized along the string length by $s$. Similarly $\backslash vec(s=S,t)$ is the trajectory of an infinitesimal segment of the string during transformation of the entire string from conformation $\backslash vec(s,0)$ to conformation $\backslash vec(s,T)$. The term with cofactor $\backslash lambda$ is a Lagrange multiplier
In mathematical optimization
File:Nelder-Mead Simionescu.gif, Nelder-Mead minimum search of Test functions for optimization, Simionescu's function. Simplex vertices are ordered by their values, with 1 having the lowest ( best) value., alt=
Mat ...

and its role is to ensure that the length of the polymer remains the same during the transformation. If two discrete polymers are inextensible, then the minimal-distance transformation between them no longer involves purely straight-line motion, even on a Euclidean metric. There is a potential application of such generalized distance to the problem of protein folding
Protein folding is the physical process
Physical changes are changes affecting the form of a chemical substance
A chemical substance is a form of matter
In classical physics and general chemistry, matter is any substance that has mass ...

.
This generalized distance is analogous to the Nambu–Goto action
The Nambu–Goto action is the simplest invariant action
ACTION is a bus operator in Canberra
Canberra ( )
is the capital city of Australia. Founded following the Federation of Australia, federation of the colonies of Australia as the ...

in string theory
In physics, string theory is a Mathematical theory, theoretical framework in which the Point particle, point-like particles of particle physics are replaced by Dimension (mathematics and physics), one-dimensional objects called String (physic ...

, however there is no exact correspondence because the Euclidean distance in 3-space is inequivalent to the spacetime distance minimized for the classical relativistic string.
Algebraic distance

This is a metric often used incomputer vision
Computer vision is an interdisciplinary scientific field that deals with how computer
A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically. Modern computers can perform ge ...

that can be minimized by 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 resid ...

estimationhttp://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/FISHER/CIRCLEFIT/fit2dcircle/node3.html] For curves or surfaces given by the equation $x^\backslash text\; C\; x=0$ (such as a Conic#Homogeneous coordinates, conic in homogeneous coordinates), the algebraic distance from the point $x\text{'}$ to the curve is simply $x\text{'}^\backslash text\; C\; x\text{'}$. It may serve as an "initial guess" for geometric distance to refine estimations of the curve by more accurate methods, such as

non-linear least squares
Non-linear least squares is the form of least squares analysis used to fit a set of ''m'' observations with a model that is non-linear in ''n'' unknown parameters (''m'' ≥ ''n''). It is used in some forms of nonlinear regression. The b ...

.
General metric

Inmathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and their changes (cal ...

, in particular geometry
Geometry (from the grc, γεωμετρία; ' "earth", ' "measurement") is, with , one of the oldest branches of . It is concerned with properties of space that are related with distance, shape, size, and relative position of figures. A mat ...

, a distance function
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no ge ...

on a given set ''M'' is a function
Function or functionality may refer to:
Computing
* Function key
A function key is a key on a computer
A computer is a machine that can be programmed to carry out sequences of arithmetic or logical operations automatically. Modern comp ...

, where R denotes the set of real number
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no g ...

s, that satisfies the following conditions:
*, and if and only if
In logic
Logic is an interdisciplinary field which studies truth and reasoning. Informal logic seeks to characterize Validity (logic), valid arguments informally, for instance by listing varieties of fallacies. Formal logic represents st ...

. (Distance is positive between two different points, and is zero precisely from a point to itself.)
*It is symmetric
Symmetry (from Greek συμμετρία ''symmetria'' "agreement in dimensions, due proportion, arrangement") in everyday language refers to a sense of harmonious and beautiful proportion and balance. In mathematics, "symmetry" has a more pre ...

: . (The distance between ''x'' and ''y'' is the same in either direction.)
*It satisfies the triangle inequality
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities an ...

: . (The distance between two points is the shortest distance along any path). Such a distance function is known as a metric
METRIC (Mapping EvapoTranspiration at high Resolution with Internalized Calibration) is a computer model
Computer simulation is the process of mathematical modelling, performed on a computer, which is designed to predict the behaviour of or th ...

. Together with the set, it makes up a metric space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...

.
For example, the usual definition of distance between two real numbers ''x'' and ''y'' is: . This definition satisfies the three conditions above, and corresponds to the standard topology
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities ...

of the real line
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities an ...

. But distance on a given set is a definitional choice. Another possible choice is to define: if , and 1 otherwise. This also defines a metric, but gives a completely different topology, the "discrete topology
In topology
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), an ...

"; with this definition numbers cannot be arbitrarily close.
Distances between sets and between a point and a set

Various distance definitions are possible between objects. For example, between celestial bodies one should not confuse the surface-to-surface distance and the center-to-center distance. If the former is much less than the latter, as for alow Earth orbit
A low Earth orbit (LEO) is an Earth-centered orbit near the planet, often specified as having a period
Period may refer to:
Common uses
* Era, a length or span of time
* Full stop (or period), a punctuation mark
Arts, entertainment, and media ...

, the first tends to be quoted (altitude), otherwise, e.g. for the Earth–Moon distance, the latter.
There are two common definitions for the distance between two non-empty subset
In mathematics
Mathematics (from Ancient Greek, Greek: ) includes the study of such topics as quantity (number theory), mathematical structure, structure (algebra), space (geometry), and calculus, change (mathematical analysis, analysis). ...

s of a given metric space
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities and t ...

:
*One version of distance between two non-empty sets is the infimum
In mathematics, the infimum (abbreviated inf; plural infima) of a subset S of a partially ordered set P is a greatest element in P that is less than or equal to all elements of S, if such an element exists. Consequently, the term ''greatest low ...

of the distances between any two of their respective points, which is the everyday meaning of the word, i.e.
::$d(A,B)=\backslash inf\_\; d(x,y).$
:This is a symmetric premetric. On a collection of sets of which some touch or overlap each other, it is not "separating", because the distance between two different but touching or overlapping sets is zero. Also it is not hemimetric space, hemimetric, i.e., the triangle inequality
In mathematics
Mathematics (from Greek: ) includes the study of such topics as numbers (arithmetic and number theory), formulas and related structures (algebra), shapes and spaces in which they are contained (geometry), and quantities an ...

does not hold, except in special cases. Therefore only in special cases this distance makes a collection of sets a Graph theory

In graph theory the Distance (graph theory), distance between two vertices is the length of the shortest path (graph theory), path between those vertices.Statistical distances

In statistics and information geometry, there are many kinds of statistical distances, notably divergence (statistics), divergences, especially Bregman divergences and f-divergence, ''f''-divergences. These include and generalize many of the notions of "difference between two probability distributions", and allow them to be studied geometrically, as statistical manifolds. The most elementary is the squared Euclidean distance, which forms the basis ofleast 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 resid ...

; 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 the most basic ''f''-divergence, and is also a Bregman divergence (and is the only divergence that 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 (from Greek: ) includes the study of such topics as numbers ( and ), formulas and related structures (), shapes and spaces in which they are contained (), and quantities and their changes ( and ). There is no ...

(which is traditionally true for squared Euclidean distance) to be used for linear inverse problems in inference by optimization theory.
Other important statistical distances include the Mahalanobis distance, the energy distance, and many others.
Other mathematical "distances"

*Canberra distance – a weighted version of Manhattan distance, used in computer scienceIn psychology

Psychological distance is defined as "the different ways in which an object might be removed from" the self along dimensions such as "time, space, social distance, and hypotheticality". The relation between psychological distance and the extent to which abstract thinking, thinking is abstract or concrete is described in construal level theory, a framework for decision-making.See also

*Astronomical system of units *Color difference *Cosmic distance ladder *Distance geometry problem *Dijkstra's algorithm *Distance matrix *Distance measuring device *Distance measuring equipment (aviation) (DME) *Exit number#Distance-based numbers, Distance-based road exit numbers *Engineering tolerance *Length *Meridian arc *Milestone *Multiplicative distance *Orders of magnitude (length) *Perpendicular distance *Proper length *Proxemics – physical distance between people *Rangefinder *Signed distance function *Social distancing *Vertical distanceLibrary Support

* Python (programming language) *Interspace

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

-Distance computations (

`scipy.spatial.distance`

)
*Julia (programming language)
Julia Statistics Distance

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

References

Bibliography

* {{Authority control Distance, Elementary mathematics Metric geometry