Euclidean metric
   HOME

TheInfoList



OR:

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 ...
, the Euclidean distance between two points in
Euclidean space Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, that is, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are Euclidea ...
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 Inte ...
of a
line segment In geometry, a line segment is a part of a straight line that is bounded by two distinct end points, and contains every point on the line that is between its endpoints. The length of a line segment is given by the Euclidean distance between i ...
between the two
points Point or points may refer to: Places * Point, Lewis, a peninsula in the Outer Hebrides, Scotland * Point, Texas, a city in Rains County, Texas, United States * Point, the NE tip and a ferry terminal of Lismore, Inner Hebrides, Scotland * Points ...
. It can be calculated from the
Cartesian coordinate A Cartesian coordinate system (, ) in a plane is a coordinate system that specifies each point uniquely by a pair of numerical coordinates, which are the signed distances to the point from two fixed perpendicular oriented lines, measured in ...
s of the points using the
Pythagorean theorem In mathematics, the Pythagorean theorem or Pythagoras' theorem is a fundamental relation in Euclidean geometry between the three sides of a right triangle. It states that the area of the square whose side is the hypotenuse (the side opposit ...
, therefore occasionally being called the Pythagorean distance. These names come from the ancient Greek mathematicians
Euclid Euclid (; grc-gre, Εὐκλείδης; BC) was an ancient Greek mathematician active as a geometer and logician. Considered the "father of geometry", he is chiefly known for the '' Elements'' treatise, which established the foundations of ...
and
Pythagoras Pythagoras of Samos ( grc, Πυθαγόρας ὁ Σάμιος, Pythagóras ho Sámios, Pythagoras the Samian, or simply ; in Ionian Greek; ) was an ancient Ionian Greek philosopher and the eponymous founder of Pythagoreanism. His poli ...
, although Euclid did not represent distances as numbers, and the connection from the Pythagorean theorem to distance calculation was not made until the 18th century. The distance between two objects that are not points is usually defined to be the smallest distance among pairs of points from the two objects. Formulas are known for computing distances between different types of objects, such as the distance from a point to a line. In advanced mathematics, the concept of distance has been generalized to abstract
metric space In mathematics, a metric space is a set together with a notion of '' distance'' between its elements, usually called points. The distance is measured by a function called a metric or distance function. Metric spaces are the most general setti ...
s, and other distances than Euclidean have been studied. In some applications in
statistics 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, indust ...
and
optimization Mathematical optimization (alternatively spelled ''optimisation'') or mathematical programming is the selection of a best element, with regard to some criterion, from some set of available alternatives. It is generally divided into two subfi ...
, the square of the Euclidean distance is used instead of the distance itself.


Distance formulas


One dimension

The distance between any two points on the
real line In elementary mathematics, a number line is a picture of a graduated straight line that serves as visual representation of the real numbers. Every point of a number line is assumed to correspond to a real number, and every real number to a po ...
is the
absolute value In mathematics, the absolute value or modulus of a real number x, is the non-negative value without regard to its sign. Namely, , x, =x if is a positive number, and , x, =-x if x is negative (in which case negating x makes -x positive), ...
of the numerical difference of their coordinates, their
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 for ...
. Thus if p and q are two points on the real line, then the distance between them is given by: d(p,q) = , p-q, . A more complicated formula, giving the same value, but generalizing more readily to higher dimensions, is: d(p,q) = \sqrt. In this formula, squaring and then taking the
square root In mathematics, a square root of a number is a number such that ; in other words, a number whose '' square'' (the result of multiplying the number by itself, or  ⋅ ) is . For example, 4 and −4 are square roots of 16, because . ...
leaves any positive number unchanged, but replaces any negative number by its absolute value.


Two dimensions

In the
Euclidean plane In mathematics, the Euclidean plane is a Euclidean space of dimension two. That is, a geometric setting in which two real quantities are required to determine the position of each point ( element of the plane), which includes affine notions ...
, let point p have
Cartesian coordinates A Cartesian coordinate system (, ) in a plane is a coordinate system that specifies each point uniquely by a pair of numerical coordinates, which are the signed distances to the point from two fixed perpendicular oriented lines, measured in ...
(p_1,p_2) and let point q have coordinates (q_1,q_2). Then the distance between p and q is given by: d(p,q) = \sqrt. This can be seen by applying the
Pythagorean theorem In mathematics, the Pythagorean theorem or Pythagoras' theorem is a fundamental relation in Euclidean geometry between the three sides of a right triangle. It states that the area of the square whose side is the hypotenuse (the side opposit ...
to a
right triangle A right triangle (American English) or right-angled triangle ( British), or more formally an orthogonal triangle, formerly called a rectangled triangle ( grc, ὀρθόσγωνία, lit=upright angle), is a triangle in which one angle is a right a ...
with horizontal and vertical sides, having the line segment from p to q as its hypotenuse. The two squared formulas inside the square root give the areas of squares on the horizontal and vertical sides, and the outer square root converts the area of the square on the hypotenuse into the length of the hypotenuse. It is also possible to compute the distance for points given by
polar coordinates In mathematics, the polar coordinate system is a two-dimensional coordinate system in which each point on a plane is determined by a distance from a reference point and an angle from a reference direction. The reference point (analogous to th ...
. If the polar coordinates of p are (r,\theta) and the polar coordinates of q are (s,\psi), then their distance is given by the
law of cosines In trigonometry, the law of cosines (also known as the cosine formula, cosine rule, or al-Kashi's theorem) relates the lengths of the sides of a triangle to the cosine of one of its angles. Using notation as in Fig. 1, the law of cosines states ...
: d(p,q)=\sqrt. When p and q are expressed as
complex number In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the fo ...
s in the
complex plane In mathematics, the complex plane is the plane formed by the complex numbers, with a Cartesian coordinate system such that the -axis, called the real axis, is formed by the real numbers, and the -axis, called the imaginary axis, is formed by the ...
, the same formula for one-dimensional points expressed as real numbers can be used, although here the absolute value sign indicates the complex norm: d(p,q)=, p-q, .


Higher dimensions

In three dimensions, for points given by their Cartesian coordinates, the distance is d(p,q)=\sqrt. In general, for points given by Cartesian coordinates in n-dimensional Euclidean space, the distance is d(p,q) = \sqrt.


Objects other than points

For pairs of objects that are not both points, the distance can most simply be defined as the smallest distance between any two points from the two objects, although more complicated generalizations from points to sets such as
Hausdorff distance In mathematics, the Hausdorff distance, or Hausdorff metric, also called Pompeiu–Hausdorff distance, measures how far two subsets of a metric space are from each other. It turns the set of non-empty compact subsets of a metric space into a met ...
are also commonly used. Formulas for computing distances between different types of objects include: *The distance from a point to a line, in the Euclidean plane *The distance from a point to a plane in three-dimensional Euclidean space *The distance between two lines in three-dimensional Euclidean space


Properties

The Euclidean distance is the prototypical example of the distance in a
metric space In mathematics, a metric space is a set together with a notion of '' distance'' between its elements, usually called points. The distance is measured by a function called a metric or distance function. Metric spaces are the most general setti ...
, and obeys all the defining properties of a metric space: *It is ''symmetric'', meaning that for all points p and q, d(p,q)=d(q,p). That is (unlike road distance with one-way streets) the distance between two points does not depend on which of the two points is the start and which is the destination. *It is ''positive'', meaning that the distance between every two distinct points is a
positive number In mathematics, the sign of a real number is its property of being either positive, negative, or zero. Depending on local conventions, zero may be considered as being neither positive nor negative (having no sign or a unique third sign), or it ...
, while the distance from any point to itself is zero. *It obeys the
triangle inequality In mathematics, the triangle inequality states that for any triangle, the sum of the lengths of any two sides must be greater than or equal to the length of the remaining side. This statement permits the inclusion of degenerate triangles, but ...
: for every three points p, q, and r, d(p,q)+d(q,r)\ge d(p,r). Intuitively, traveling from p to r via q cannot be any shorter than traveling directly from p to r. Another property,
Ptolemy's inequality In Euclidean geometry, Ptolemy's inequality relates the six distances determined by four points in the plane or in a higher-dimensional space. It states that, for any four points , , , and , the following inequality holds: :\overline\cdot \over ...
, concerns the Euclidean distances among four points p, q, r, and s. It states that d(p,q)\cdot d(r,s)+d(q,r)\cdot d(p,s)\ge d(p,r)\cdot d(q,s). For points in the plane, this can be rephrased as stating that for every
quadrilateral In geometry a quadrilateral is a four-sided polygon, having four edges (sides) and four corners (vertices). The word is derived from the Latin words ''quadri'', a variant of four, and ''latus'', meaning "side". It is also called a tetragon, ...
, the products of opposite sides of the quadrilateral sum to at least as large a number as the product of its diagonals. However, Ptolemy's inequality applies more generally to points in Euclidean spaces of any dimension, no matter how they are arranged. For points in metric spaces that are not Euclidean spaces, this inequality may not be true. Euclidean distance geometry studies properties of Euclidean distance such as Ptolemy's inequality, and their application in testing whether given sets of distances come from points in a Euclidean space. According to the Beckman–Quarles theorem, any transformation of the Euclidean plane or of a higher-dimensional Euclidean space that preserves unit distances must be an
isometry In mathematics, an isometry (or congruence, or congruent transformation) is a distance-preserving transformation between metric spaces, usually assumed to be bijective. The word isometry is derived from the Ancient Greek: ἴσος ''isos'' ...
, preserving all distances.


Squared Euclidean distance

In many applications, and in particular when comparing distances, it may be more convenient to omit the final square root in the calculation of Euclidean distances. The value resulting from this omission is the
square In Euclidean geometry, a square is a regular quadrilateral, which means that it has four equal sides and four equal angles (90- degree angles, π/2 radian angles, or right angles). It can also be defined as a rectangle with two equal-length a ...
of the Euclidean distance, and is called the squared Euclidean distance. As an equation, it can be expressed as a
sum of squares In mathematics, statistics and elsewhere, sums of squares occur in a number of contexts: Statistics * For partitioning of variance, see Partition of sums of squares * For the "sum of squared deviations", see Least squares * For the "sum of square ...
: d^2(p,q) = (p_1 - q_1)^2 + (p_2 - q_2)^2+\cdots+(p_i - q_i)^2+\cdots+(p_n - q_n)^2. Beyond its application to distance comparison, squared Euclidean distance is of central importance in
statistics 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, indust ...
, where it is used in the method of
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 re ...
, a standard method of fitting statistical estimates to data by minimizing the average of the squared distances between observed and estimated values, and as the simplest form of
divergence In vector calculus, divergence is a vector operator that operates on a vector field, producing a scalar field giving the quantity of the vector field's source at each point. More technically, the divergence represents the volume density of ...
to compare
probability distribution In probability theory and statistics, a probability distribution is the mathematical function that gives the probabilities of occurrence of different possible outcomes for an experiment. It is a mathematical description of a random phenomenon ...
s. The addition of squared distances to each other, as is done in least squares fitting, corresponds to an operation on (unsquared) distances called
Pythagorean addition In mathematics, Pythagorean addition is a binary operation on the real numbers that computes the length of the hypotenuse of a right triangle, given its two sides. According to the Pythagorean theorem, for a triangle with sides a and b, this leng ...
. In
cluster analysis Cluster analysis or clustering is the task of grouping a set of objects in such a way that objects in the same group (called a cluster) are more similar (in some sense) to each other than to those in other groups (clusters). It is a main task of ...
, squared distances can be used to strengthen the effect of longer distances. Squared Euclidean distance does not form a metric space, as it does not satisfy the triangle inequality. However it is a smooth, strictly
convex function In mathematics, a real-valued function is called convex if the line segment between any two points on the graph of the function lies above the graph between the two points. Equivalently, a function is convex if its epigraph (the set of poi ...
of the two points, unlike the distance, which is non-smooth (near pairs of equal points) and convex but not strictly convex. The squared distance is thus preferred in optimization theory, since it allows convex analysis to be used. Since squaring is a
monotonic function In mathematics, a monotonic function (or monotone function) is a function between ordered sets that preserves or reverses the given order. This concept first arose in calculus, and was later generalized to the more abstract setting of order ...
of non-negative values, minimizing squared distance is equivalent to minimizing the Euclidean distance, so the optimization problem is equivalent in terms of either, but easier to solve using squared distance. The collection of all squared distances between pairs of points from a finite set may be stored in a
Euclidean distance matrix In mathematics, a Euclidean distance matrix is an matrix representing the spacing of a set of points in Euclidean space. For points x_1,x_2,\ldots,x_n in -dimensional space , the elements of their Euclidean distance matrix are given by squares ...
, and is used in this form in distance geometry.


Generalizations

In more advanced areas of mathematics, when viewing Euclidean space as a
vector space In mathematics and physics, a vector space (also called a linear space) is a set whose elements, often called '' vectors'', may be added together and multiplied ("scaled") by numbers called ''scalars''. Scalars are often real numbers, but can ...
, its distance is associated with a norm called the
Euclidean norm Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, that is, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are Euclidean ...
, defined as the distance of each vector from the
origin Origin(s) or The Origin may refer to: Arts, entertainment, and media Comics and manga * Origin (comics), ''Origin'' (comics), a Wolverine comic book mini-series published by Marvel Comics in 2002 * The Origin (Buffy comic), ''The Origin'' (Bu ...
. One of the important properties of this norm, relative to other norms, is that it remains unchanged under arbitrary rotations of space around the origin. By
Dvoretzky's theorem In mathematics, Dvoretzky's theorem is an important structural theorem about normed vector spaces proved by Aryeh Dvoretzky in the early 1960s, answering a question of Alexander Grothendieck. In essence, it says that every sufficiently high-dimens ...
, every finite-dimensional normed vector space has a high-dimensional subspace on which the norm is approximately Euclidean; the Euclidean norm is the only norm with this property. It can be extended to infinite-dimensional vector spaces as the L2 norm or L2 distance. The Euclidean distance gives Euclidean space the structure of a
topological space In mathematics, a topological space is, roughly speaking, a geometrical space in which closeness is defined but cannot necessarily be measured by a numeric distance. More specifically, a topological space is a set whose elements are called poin ...
, the
Euclidean topology In mathematics, and especially general topology, the Euclidean topology is the natural topology induced on n-dimensional Euclidean space Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, ...
, with the
open ball In mathematics, a ball is the solid figure bounded by a ''sphere''; it is also called a solid sphere. It may be a closed ball (including the boundary points that constitute the sphere) or an open ball (excluding them). These concepts are defi ...
s (subsets of points at less than a given distance from a given point) as its neighborhoods. Other common distances on Euclidean spaces and low-dimensional vector spaces include: * Chebyshev distance, which measures distance assuming only the most significant dimension is relevant. *
Manhattan distance A taxicab geometry or a Manhattan geometry is a geometry whose usual distance function or 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 their Cartesian co ...
, which measures distance following only axis-aligned directions. * Minkowski distance, a generalization that unifies Euclidean distance, Manhattan distance, and Chebyshev distance. For points on surfaces in three dimensions, the Euclidean distance should be distinguished from the
geodesic In geometry, a geodesic () is a curve representing in some sense the shortest path ( arc) between two points in a surface, or more generally in a Riemannian manifold. The term also has meaning in any differentiable manifold with a connecti ...
distance, the length of a shortest curve that belongs to the surface. In particular, for measuring great-circle distances on the earth or other spherical or near-spherical surfaces, distances that have been used include the haversine distance giving great-circle distances between two points on a sphere from their longitudes and latitudes, and
Vincenty's formulae Vincenty's formulae are two related iterative methods used in geodesy to calculate the distance between two points on the surface of a spheroid, developed by Thaddeus Vincenty (1975a). They are based on the assumption that the figure of the Earth ...
also known as "Vincent distance" for distance on a spheroid.


History

Euclidean distance is the distance in
Euclidean space Euclidean space is the fundamental space of geometry, intended to represent physical space. Originally, that is, in Euclid's ''Elements'', it was the three-dimensional space of Euclidean geometry, but in modern mathematics there are Euclidea ...
; both concepts are named after ancient Greek mathematician
Euclid Euclid (; grc-gre, Εὐκλείδης; BC) was an ancient Greek mathematician active as a geometer and logician. Considered the "father of geometry", he is chiefly known for the '' Elements'' treatise, which established the foundations of ...
, whose ''Elements'' became a standard textbook in geometry for many centuries. Concepts of
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 Inte ...
and
distance Distance is a numerical or occasionally qualitative measurement of how far apart objects or points are. In physics or everyday usage, distance may refer to a physical length or an estimation based on other criteria (e.g. "two counties over"). ...
are widespread across cultures, can be dated to the earliest surviving "protoliterate" bureaucratic documents from
Sumer Sumer () is the earliest known civilization in the historical region of southern Mesopotamia (south-central Iraq), emerging during the Chalcolithic and early Bronze Ages between the sixth and fifth millennium BC. It is one of the cradles of ...
in the fourth millennium BC (far before Euclid), and have been hypothesized to develop in children earlier than the related concepts of speed and time. But the notion of a distance, as a number defined from two points, does not actually appear in Euclid's ''Elements''. Instead, Euclid approaches this concept implicitly, through the congruence of line segments, through the comparison of lengths of line segments, and through the concept of proportionality. The
Pythagorean theorem In mathematics, the Pythagorean theorem or Pythagoras' theorem is a fundamental relation in Euclidean geometry between the three sides of a right triangle. It states that the area of the square whose side is the hypotenuse (the side opposit ...
is also ancient, but it could only take its central role in the measurement of distances after the invention of
Cartesian coordinates A Cartesian coordinate system (, ) in a plane is a coordinate system that specifies each point uniquely by a pair of numerical coordinates, which are the signed distances to the point from two fixed perpendicular oriented lines, measured in ...
by
René Descartes René Descartes ( or ; ; Latinized: Renatus Cartesius; 31 March 1596 – 11 February 1650) was a French philosopher, scientist, and mathematician, widely considered a seminal figure in the emergence of modern philosophy and science. Ma ...
in 1637. The distance formula itself was first published in 1731 by
Alexis Clairaut Alexis Claude Clairaut (; 13 May 1713 – 17 May 1765) was a French mathematician, astronomer, and geophysicist. He was a prominent Newtonian whose work helped to establish the validity of the principles and results that Sir Isaac Newton had ou ...
. Because of this formula, Euclidean distance is also sometimes called Pythagorean distance. Although accurate measurements of long distances on the earth's surface, which are not Euclidean, had again been studied in many cultures since ancient times (see
history of geodesy The history of geodesy deals with the historical development of measurements and representations of the Earth. The corresponding scientific discipline, '' geodesy'' ( /dʒiːˈɒdɪsi/), began in pre-scientific antiquity and blossomed during th ...
), the idea that Euclidean distance might not be the only way of measuring distances between points in mathematical spaces came even later, with the 19th-century formulation of
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 g ...
. The definition of the Euclidean norm and Euclidean distance for geometries of more than three dimensions also first appeared in the 19th century, in the work of
Augustin-Louis Cauchy Baron Augustin-Louis Cauchy (, ; ; 21 August 178923 May 1857) was a French mathematician, engineer, and physicist who made pioneering contributions to several branches of mathematics, including mathematical analysis and continuum mechanics. H ...
.


References

{{DEFAULTSORT:Euclidean Distance Distance Length Metric geometry Pythagorean theorem