• Skip to primary navigation
  • Skip to main content
  • Skip to footer
Basic Mathematics
  • ⌕
Distance Between Two Points: Plane and Space Formulas

Distance Between Two Points: Plane and Space Formulas

Written by Jean Carlos Novaes

The distance between two points is the length of the straight segment joining them. In Cartesian coordinates, horizontal and vertical changes form perpendicular legs of a right triangle. Their signs disappear after squaring, but the distance itself is always nonnegative.

Build the distance formula from Pythagoras

Subtract the x-coordinates and the y-coordinates in a consistent order, square both differences, add and take the nonnegative square root. The formula works for every pair of points in the plane, including horizontal and vertical pairs.

Δx=x2−x1
Δy=y2−y1
d=Δx2+Δy2

If one coordinate is equal, the corresponding difference is zero and the calculation reduces to the absolute difference of the other coordinates. Coincident points have distance zero. Reversing the point order leaves the distance unchanged.

The segment from A to B is the hypotenuse. Dashed horizontal and vertical changes form its two perpendicular legs.
The segment from A to B is the hypotenuse. Dashed horizontal and vertical changes form its two perpendicular legs.

Worked example: A(2, 3) and B(3, 1)

The horizontal change is 1 and the vertical change −2. Their squares are 1 and 4, so the distance is the square root of 5, not the square root of 2. Keep the exact root before rounding.

d=(3−2)2+(1−3)2
d=1+4=5≈2.24

Extend the same reasoning to three dimensions

Add the square of the z-coordinate difference under the same square root. Pythagoras is applied first in a plane and then to the remaining perpendicular direction.

d=Δx2+Δy2+Δz2

For A(1, 2, 3) and B(4, 3, 1), the coordinate changes are 3, 1 and −2. Their squared sum is 14.

d=32+12+(−2)2=14

If both z-coordinates are zero, the points still belong to three-dimensional space but lie in its coordinate plane. The two-dimensional formula then gives the same result.

Move point B in the coordinate plane

Point A stays at (2, 3). Move B with the sliders to compare the straight distance with its horizontal and vertical components.

Coordinates must use compatible units and perpendicular axes. This Euclidean formula does not directly measure routes along streets or distances from latitude and longitude. Compare separation with a line’s slope, which describes direction rather than length.

References

  • OpenStax. Intermediate Algebra 2e: Distance and Midpoint Formulas.
Jean Carlos Novaes

About Jean Carlos Novaes

I hold a degree in Computer Science from the Federal University of Bahia (2017) and I am the editor and founder of this website.

Footer

Basic Mathematics

Basic Mathematics website with clear school content for elementary and high school students. Learn easily and efficiently!

ABOUT

  • About Us
  • Contact
  • Site Map

LEGAL

  • How to Cite
  • Cookie Policy
  • Privacy Policy
  • Content License
English
  • Portuguese (Português)
  • Danish (Dansk)
  • German (Deutsch)
  • English
  • Spanish (Español)
  • Finnish (Suomi)
  • French (Français)
  • Italian (Italiano)
  • Dutch (Nederlands)
  • Norwegian (Norsk)
  • Polish (Polski)
  • Portuguese (Portugal)
  • Swedish (Svenska)

© 2015–2026 · Basic Mathematics · All rights reserved.