Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Euclidean distance
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Two dimensions === In the [[Euclidean plane]], let point <math>p</math> have [[Cartesian coordinates]] <math>(p_1,p_2)</math> and let point <math>q</math> have coordinates <math>(q_1,q_2)</math>. Then the distance between <math>p</math> and <math>q</math> is given by:<ref name=cohen>{{citation|title=Precalculus: A Problems-Oriented Approach|first=David|last=Cohen|edition=6th|publisher=Cengage Learning|year=2004|isbn=978-0-534-40212-9|page=698|url=https://books.google.com/books?id=_6ukev29gmgC&pg=PA698}}</ref> <math display=block>d(p,q) = \sqrt{(p_1-q_1)^2 + (p_2-q_2)^2}.</math> This can be seen by applying the [[Pythagorean theorem]] to a [[right triangle]] with horizontal and vertical sides, having the line segment from <math>p</math> to <math>q</math> 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.<ref>{{citation|title=College Trigonometry|first1=Richard N.|last1=Aufmann|first2=Vernon C.|last2=Barker|first3=Richard D.|last3=Nation|edition=6th|publisher=Cengage Learning|year=2007|isbn=978-1-111-80864-8|page=17|url=https://books.google.com/books?id=kZ8HAAAAQBAJ&pg=PA17}}</ref> In terms of the [[Pythagorean addition]] operation <math>\oplus</math>, available in many [[software library|software libraries]] as <code>hypot</code>, the same formula can be expressed as:<ref>{{citation|title=Java Script Notes for Professionals|first=Rohit|last=Manglik|publisher=EduGorilla|year=2024|isbn=9789367840320|contribution=Section 14.22: Math.hypot|page=144|contribution-url=https://books.google.com/books?id=jwU6EQAAQBAJ&pg=PA144}}</ref> <math display=block>d(p,q) = (p_1-q_1) \oplus (p_2-q_2) = \mathsf{hypot}(p_1-q_1,p_2-q_2).</math> It is also possible to compute the distance for points given by [[Polar coordinate system|polar coordinates]]. If the polar coordinates of <math>p</math> are <math>(r,\theta)</math> and the polar coordinates of <math>q</math> are <math>(s,\psi)</math>, then their distance is<ref name=cohen /> given by the [[law of cosines]]: <math display=block>d(p,q)=\sqrt{r^2 + s^2 - 2rs\cos(\theta-\psi)}.</math> When <math>p</math> and <math>q</math> are expressed as [[complex number]]s in the [[complex plane]], the same formula for one-dimensional points expressed as real numbers can be used, although here the absolute value sign indicates the [[complex norm]]:<ref>{{citation|title=Complex Numbers from A to ... Z|first1=Titu|last1=Andreescu|first2=Dorin|last2=Andrica|publisher=Birkhäuser|year=2014|edition=2nd|isbn=978-0-8176-8415-0|contribution=3.1.1 The Distance Between Two Points|pages=57–58}}</ref> <math display=block>d(p,q)=|p-q|.</math>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)