Jump to content

Euclidean distance: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
→‎Two dimensions: source pythagorean explanation
Split off new properties section, expand metric properties and Ptolemy's ineq
Line 39: Line 39:
*The [[distance from a point to a plane]] in three-dimensional Euclidean space
*The [[distance from a point to a plane]] in three-dimensional Euclidean space
*The [[Skew lines#Distance|distance between two lines]] in three-dimensional Euclidean space
*The [[Skew lines#Distance|distance between two lines]] in three-dimensional Euclidean space

==Properties==
The Euclidean distance is the prototypical example of a [[metric space]],<ref>{{citation|title=Easy as π?: An Introduction to Higher Mathematics|first=Oleg A.|last=Ivanov|publisher=Springer|year=2013|isbn=9781461205531|page=140|url=https://books.google.com/books?id=reALBwAAQBAJ&pg=PA140}}</ref> and obeys all the defining properties of a metric space:<ref name=strichartz>{{citation|title=The Way of Analysis|first=Robert S.|last=Strichartz|publisher=Jones & Bartlett Learning|year=2000|isbn=9780763714970|page=357|url=https://books.google.com/books?id=Yix09oVvI1IC&pg=PA357}}</ref>
*It is ''symmetric'', meaning that for all points <math>p</math> and <math>q</math>, <math>d(p,q)=d(q,p)</math>. 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.<ref name=strichartz/>
*It is ''positive'', meaning that the distance between every two distinct points is a [[positive number]], while the distance from any point to itself is zero.<ref name=strichartz/>
*It obeys the [[triangle inequality]]: for every three points <math>p</math>, <math>q</math>, and <math>r</math>, <math>d(p,q)+d(p,r)\ge d(p,r)</math>. Intuitively, traveling from <math>p</math> to <math>r</math> via <math>q</math> cannot be any shorter than traveling directly from <math>p</math> to <math>r</math>.<ref name=strichartz/>

There are additional properties that are obeyed by the Euclidean distance but not by the distances of some other metric spaces. For instance, [[Ptolemy's inequality]] concerns the Euclidean distances among four points <math>p</math>, <math>q</math>, <math>r</math>, and <math>s</math>, and states that
:<math>d(p,q)\cdot d(r,s)+d(q,r)\cdot d(p,s)\ge d(p,r)\cdot d(q,s).</math>
For points in the plane, this can be rephrased as stating that for every [[quadrilateral]], 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.<ref>{{citation|title=Rays, Waves, and Scattering: Topics in Classical Mathematical Physics|series=Princeton Series in Applied Mathematics|first=John A.|last=Adam|publisher=Princeton University Press|year=2017|isbn=9781400885404|pages=26–27|url=https://books.google.com/books?id=DnygDgAAQBAJ&pg=PA26}}</ref>
Euclidean [[distance geometry]] studies these properties of Euclidean distance, and their application in testing whether given sets of distances come from points in a Euclidean space.<ref>{{citation|title=Euclidean Distance Geometry: An Introduction|series=Springer Undergraduate Texts in Mathematics and Technology|first1=Leo|last1=Liberti|first2=Carlile|last2=Lavor|publisher=Springer|year=2017|isbn=9783319607924|page=xi|url=https://books.google.com/books?id=jOQ2DwAAQBAJ&pg=PP10}}</ref>


==Squared Euclidean distance==
==Squared Euclidean distance==
Line 52: Line 63:


==Generalizations==
==Generalizations==
In more advanced areas of mathematics, Euclidean space and its distance provides a standard example of a [[metric space]], called the '''Euclidean metric'''. Euclidean [[distance geometry]] studies properties of Euclidean geometry in terms of its distances, and properties of sets of distances that can be used to determine whether they come from the Euclidean metric.<ref>{{citation|title=Euclidean Distance Geometry: An Introduction|series=Springer Undergraduate Texts in Mathematics and Technology|first1=Leo|last1=Liberti|first2=Carlile|last2=Lavor|publisher=Springer|year=2017|isbn=9783319607924|page=xi|url=https://books.google.com/books?id=jOQ2DwAAQBAJ&pg=PP10}}</ref> When viewing Euclidean space as a [[vector space]], its distance is associated with a [[Norm (mathematics)|norm]] called the [[Norm (mathematics)#Euclidean norm|Euclidean norm]], defined as the distance of each vector from the [[Origin (mathematics)|origin]]. 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.<ref>{{citation|title=Relativistic Celestial Mechanics of the Solar System|first1=Sergei|last1=Kopeikin|first2=Michael|last2=Efroimsky|first3=George|last3=Kaplan|publisher=John Wiley & Sons|year=2011|isbn=9783527634576|page=106|url=https://books.google.com/books?id=uN5_DQWSR14C&pg=PA106}}</ref> By [[Dvoretzky's theorem]], every finite-dimensional [[normed vector space]] has a high-dimensional subspace on which the norm is approximately Euclidean; the Euclidean norm is the
In more advanced areas of mathematics, when viewing Euclidean space as a [[vector space]], its distance is associated with a [[Norm (mathematics)|norm]] called the [[Norm (mathematics)#Euclidean norm|Euclidean norm]], defined as the distance of each vector from the [[Origin (mathematics)|origin]]. 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.<ref>{{citation|title=Relativistic Celestial Mechanics of the Solar System|first1=Sergei|last1=Kopeikin|first2=Michael|last2=Efroimsky|first3=George|last3=Kaplan|publisher=John Wiley & Sons|year=2011|isbn=9783527634576|page=106|url=https://books.google.com/books?id=uN5_DQWSR14C&pg=PA106}}</ref> By [[Dvoretzky's theorem]], 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.<ref>{{citation|last=Matoušek|first=Jiří|author-link=Jiří Matoušek (mathematician)|isbn=978-0-387-95373-1|page=349|publisher=Springer|series=[[Graduate Texts in Mathematics]]|title=Lectures on Discrete Geometry|url=https://books.google.com/books?id=K0fhBwAAQBAJ&pg=PA349|year=2002}}</ref> It can be extended to infinite-dimensional vector spaces as the [[Lp space|L<sup>2</sup> norm]] or L<sup>2</sup> distance.<ref>{{citation|title=Linear and Nonlinear Functional Analysis with Applications|first=Philippe G.|last=Ciarlet|publisher=Society for Industrial and Applied Mathematics|year=2013|isbn=9781611972580|page=173|url=https://books.google.com/books?id=AUlWAQAAQBAJ&pg=PA173}}</ref>
only norm with this property.<ref>{{citation|last=Matoušek|first=Jiří|author-link=Jiří Matoušek (mathematician)|isbn=978-0-387-95373-1|page=349|publisher=Springer|series=[[Graduate Texts in Mathematics]]|title=Lectures on Discrete Geometry|url=https://books.google.com/books?id=K0fhBwAAQBAJ&pg=PA349|year=2002}}</ref> It can be extended to infinite-dimensional vector spaces as the [[Lp space|L<sup>2</sup> norm]] or L<sup>2</sup> distance.<ref>{{citation|title=Linear and Nonlinear Functional Analysis with Applications|first=Philippe G.|last=Ciarlet|publisher=Society for Industrial and Applied Mathematics|year=2013|isbn=9781611972580|page=173|url=https://books.google.com/books?id=AUlWAQAAQBAJ&pg=PA173}}</ref>



Revision as of 00:43, 1 November 2020

Using the Pythagorean theorem to compute two-dimensional Euclidean distance

In mathematics, the Euclidean distance between two points in Euclidean space is a number, the length of a line segment between the two points. It can be calculated from the Cartesian coordinates of the points using the Pythagorean theorem, and is occasionally called the Pythagorean distance. These names come from the ancient Greek mathematicians Euclid and Pythagoras, but Euclid did not represent distances as numbers, and the connection from the Pythagorean theorem to distance calculation was not made until the 17th 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 spaces, and other distances than Euclidean have been studied. In some applications in statistics and optimization, 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 is the absolute value of the numerical difference of their coordinates. Thus if and are two points on the real line, then the distance between them is given by:[1]

A more complicated formula, giving the same value, but generalizing more readily to higher dimensions, is:[1]

In this formula, squaring and then taking the square root leaves any positive number unchanged, but replaces any negative number by its absolute value.[1]

Two dimensions

In the Euclidean plane, let point have Cartesian coordinates and let point have coordinates . Then the distance between and is given by:[2]

This can be seen by applying the Pythagorean theorem to a right triangle with horizontal and vertical sides, having the line segment from to 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.[3]

It is also possible to compute the distance for points given by polar coordinates. If the polar coordinates of are and the polar coordinates of are , then their distance is[2]

When and are expressed as complex numbers in the complex plane, the same formula for one-dimensional points expressed as real numbers can be used:[4]

Higher dimensions

Deriving the -dimensional Euclidean distance formula by repeatedly applying the Pythagorean theorem

In general, for points given by Cartesian coordinates in -dimensional Euclidean space, the distance is[5]

Other objects 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 are also commonly used.[6] Formulas for computing distances between different types of objects include:

Properties

The Euclidean distance is the prototypical example of a metric space,[7] and obeys all the defining properties of a metric space:[8]

  • It is symmetric, meaning that for all points and , . 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.[8]
  • It is positive, meaning that the distance between every two distinct points is a positive number, while the distance from any point to itself is zero.[8]
  • It obeys the triangle inequality: for every three points , , and , . Intuitively, traveling from to via cannot be any shorter than traveling directly from to .[8]

There are additional properties that are obeyed by the Euclidean distance but not by the distances of some other metric spaces. For instance, Ptolemy's inequality concerns the Euclidean distances among four points , , , and , and states that

For points in the plane, this can be rephrased as stating that for every quadrilateral, 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.[9] Euclidean distance geometry studies these properties of Euclidean distance, and their application in testing whether given sets of distances come from points in a Euclidean space.[10]

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 of the Euclidean distance, and is called the squared Euclidean distance.[11] As an equation:

Beyond its application to distance comparison, squared Euclidean distance is of central importance in statistics, where it is used in the method of least squares, a standard method of fitting statistical estimates to data by minimizing the average of the squared distances between observed and estimated values.[12] 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.[13] In cluster analysis, squared distances can be used to strengthen the effect of longer distances.[11]

Squared Euclidean distance is not a metric, as it does not satisfy the triangle inequality.[14] However it is a smooth, strictly convex function of the two points, unlike the distance, which is non-smooth for 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 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.[15]

The collection of all squared distances between pairs of points from a finite set may be stored in a Euclidean distance matrix.[16] In rational trigonometry, squared Euclidean distance is used because (unlike the Euclidean distance itself) the squared distance between points with rational number coordinates is always rational; in this context it is also called "quadrance".[17]

Generalizations

In more advanced areas of mathematics, when viewing Euclidean space as a vector space, its distance is associated with a norm called the Euclidean norm, defined as the distance of each vector from the origin. 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.[18] By Dvoretzky's theorem, 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.[19] It can be extended to infinite-dimensional vector spaces as the L2 norm or L2 distance.[20]

Other common distances on Euclidean spaces and low-dimensional vector spaces include:[21]

  • Chebyshev distance, which measures distance assuming only the most significant dimension is relevant.
  • Manhattan distance, 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 distance, the length of a shortest curve that belongs to the surface. In particular, for measuring great-circle distances on the earth or other 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 also known as "Vincent distance" for distance on a spheroid.[22]

History

Euclidean distance is the distance in Euclidean space; both concepts are named after ancient Greek mathematician Euclid, whose Elements became a standard textbook in geometry for many centuries.[23] Concepts of length and distance are widespread across cultures, can be dated to the earliest surviving "protoliterate" bureaucratic documents from Sumer in the fourth millenium BC (far before Euclid),[24] and have been hypothesized to develop in children earlier than the related concepts of speed and time.[25] 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.[26]

The Pythagorean theorem is also ancient, but it only took its central role in the measurement of distances with the invention of Cartesian coordinates by René Descartes in 1637.[27] Because of this connection, Euclidean distance is also sometimes called Pythagorean distance.[28] 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 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.[29] 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.[30]

References

  1. ^ a b c Smith, Karl (2013), Precalculus: A Functional Approach to Graphing and Problem Solving, Jones & Bartlett Publishers, p. 8, ISBN 9780763751777
  2. ^ a b Cohen, David (2004), Precalculus: A Problems-Oriented Approach (6th ed.), Cengage Learning, p. 698, ISBN 9780534402129
  3. ^ Aufmann, Richard N.; Barker, Vernon C.; Nation, Richard D. (2007), College Trigonometry (6th ed.), Cengage Learning, p. 17, ISBN 9781111808648
  4. ^ Andreescu, Titu; Andrica, Dorin (2014), "3.1.1 The Distance Between Two Points", Complex Numbers from A to ... Z (2nd ed.), Birkhäuser, pp. 57–58, ISBN 978-0-8176-8415-0
  5. ^ Tabak, John (2014), Geometry: The Language of Space and Form, Facts on File math library, Infobase Publishing, p. 150, ISBN 9780816068760
  6. ^ Ó Searcóid, Mícheál (2006), "2.7 Distances from Sets to Sets", Metric Spaces, Springer Undergraduate Mathematics Series, Springer, pp. 29–30, ISBN 9781846286278
  7. ^ Ivanov, Oleg A. (2013), Easy as π?: An Introduction to Higher Mathematics, Springer, p. 140, ISBN 9781461205531
  8. ^ a b c d Strichartz, Robert S. (2000), The Way of Analysis, Jones & Bartlett Learning, p. 357, ISBN 9780763714970
  9. ^ Adam, John A. (2017), Rays, Waves, and Scattering: Topics in Classical Mathematical Physics, Princeton Series in Applied Mathematics, Princeton University Press, pp. 26–27, ISBN 9781400885404
  10. ^ Liberti, Leo; Lavor, Carlile (2017), Euclidean Distance Geometry: An Introduction, Springer Undergraduate Texts in Mathematics and Technology, Springer, p. xi, ISBN 9783319607924
  11. ^ a b Spencer, Neil H. (2013), "5.4.5 Squared Euclidean Distances", Essentials of Multivariate Data Analysis, CRC Press, p. 95, ISBN 9781466584792
  12. ^ Randolph, Karen A.; Myers, Laura L. (2013), Basic Statistics in Multivariate Analysis, Pocket Guide to Social Work Research Methods, Oxford University Press, p. 116, ISBN 9780199764044
  13. ^ Moler, Cleve and Donald Morrison (1983), "Replacing Square Roots by Pythagorean Sums" (PDF), IBM Journal of Research and Development, 27 (6): 577–581, CiteSeerX 10.1.1.90.5651, doi:10.1147/rd.276.0577
  14. ^ Mielke, Paul W.; Berry, Kenneth J. (2000), "Euclidean distance based permutation methods in atmospheric science", in Brown, Timothy J.; Mielke, Paul W. Jr. (eds.), Statistical Mining and Data Visualization in Atmospheric Sciences, Springer, pp. 7–27, doi:10.1007/978-1-4757-6581-6_2
  15. ^ Kaplan, Wilfred (2011), Maxima and Minima with Applications: Practical Optimization and Duality, Wiley Series in Discrete Mathematics and Optimization, vol. 51, John Wiley & Sons, p. 61, ISBN 9781118031049
  16. ^ Alfakih, Abdo Y. (2018), Euclidean Distance Matrices and Their Applications in Rigidity Theory, Springer, p. 51, ISBN 9783319978468
  17. ^ Henle, Michael (December 2007), "Review of Divine Proportions by N. J. Wildberger", American Mathematical Monthly, 114 (10): 933–937, JSTOR 27642383
  18. ^ Kopeikin, Sergei; Efroimsky, Michael; Kaplan, George (2011), Relativistic Celestial Mechanics of the Solar System, John Wiley & Sons, p. 106, ISBN 9783527634576
  19. ^ Matoušek, Jiří (2002), Lectures on Discrete Geometry, Graduate Texts in Mathematics, Springer, p. 349, ISBN 978-0-387-95373-1
  20. ^ Ciarlet, Philippe G. (2013), Linear and Nonlinear Functional Analysis with Applications, Society for Industrial and Applied Mathematics, p. 173, ISBN 9781611972580
  21. ^ Klamroth, Kathrin (2002), "Section 1.1: Norms and Metrics", Single-Facility Location Problems with Barriers, Springer Series in Operations Research, Springer, pp. 4–6, doi:10.1007/0-387-22707-5_1
  22. ^ Panigrahi, Narayan (2014), "12.2.4 Haversine Formula and 12.2.5 Vincenty's Formula", Computing in Geographic Information Systems, CRC Press, pp. 212–214, ISBN 9781482223149
  23. ^ Zhang, Jin (2007), Visualization for Information Retrieval, Springer, ISBN 9783540751489
  24. ^ Høyrup, Jens (2018), "Mesopotamian mathematics" (PDF), in Jones, Alexander; Taub, Liba (eds.), The Cambridge History of Science, Volume 1: Ancient Science, Cambridge University Press, pp. 58–72
  25. ^ Acredolo, Curt; Schmid, Jeannine (1981), "The understanding of relative speeds, distances, and durations of movement", Developmental Psychology, 17 (4): 490–493, doi:10.1037/0012-1649.17.4.490
  26. ^ Henderson, David W. (2002), "Review of Geometry: Euclid and Beyond by Robin Hartshorne", Bulletin of the American Mathematical Society, 39: 563–571
  27. ^ Maor, Eli (2019), The Pythagorean Theorem: A 4,000-Year History, Princeton University Press, p. 133, ISBN 9780691196886
  28. ^ Rankin, William C.; Markley, Robert P.; Evans, Selby H. (March 1970), "Pythagorean distance and the judged similarity of schematic stimuli", Perception & Psychophysics, 7 (2): 103–107, doi:10.3758/bf03210143
  29. ^ Milnor, John (1982), "Hyperbolic geometry: the first 150 years", Bulletin of the American Mathematical Society, 6 (1): 9–24, doi:10.1090/S0273-0979-1982-14958-8, MR 0634431
  30. ^ Ratcliffe, John G. (2019), Foundations of Hyperbolic Manifolds, Graduate Texts in Mathematics, vol. 149 (3rd ed.), Springer, p. 32, ISBN 9783030315979