Distance formula
The distance formula gives the straight-line distance between two points on a coordinate plane. It comes directly from the Pythagorean theorem, treating the horizontal and vertical gaps as the legs of a right triangle.
- d = the straight-line distance between the points
- (x₁, y₁) = the first point
- (x₂, y₂) = the second point
Built from the Pythagorean theorem
The horizontal distance between the points, x₂ minus x₁, and the vertical distance, y₂ minus y₁, form the two legs of a right triangle. The straight-line distance is the hypotenuse, so the Pythagorean theorem gives distance squared equals the sum of the squared legs. Taking the square root yields the distance formula.
Order does not matter
Because each difference is squared, it makes no difference which point you call first; a negative difference squares to the same positive value. So you can subtract in either order and still get the correct, always-positive distance.
- Take the points (1, 2) and (4, 6).
- Horizontal gap: 4 − 1 = 3. Vertical gap: 6 − 2 = 4.
- Square and add: 3² + 4² = 9 + 16 = 25.
- Distance: √25 = 5.
Measure a distance
Use the Distance Calculator, or see the Midpoint Formula for the point halfway between.
FAQ
What is the distance formula?
d = √((x₂ − x₁)² + (y₂ − y₁)²), the straight-line distance between two points.
Why does it use a square root?
It comes from the Pythagorean theorem, where the distance is the hypotenuse of a right triangle, so you take the square root of the summed squares.
