Distance Formula: How to Find the Distance Between Two Points
The distance formula gives the straight-line distance between two points on a graph. It’s the Pythagorean theorem in disguise: the horizontal and vertical gaps are the two short sides of a right triangle.
Quick answer
d = √((x₂ − x₁)² + (y₂ − y₁)²)
Example: from (1, 2) to (4, 6), d = √(3² + 4²) = √25 = 5.
Step by step
Find the distance from (−2, 3) to (4, −5):
- First, subtract the x-values: 4 − (−2) = 6.
- Then subtract the y-values: −5 − 3 = −8.
- Next, square both and add: 36 + 64 = 100.
- Finally, take the square root: √100 = 10.
The order of the points doesn’t matter, because squaring removes any minus sign.
More examples
| Point 1 | Point 2 | Distance |
|---|---|---|
| (0, 0) | (3, 4) | 5 |
| (1, 1) | (4, 5) | 5 |
| (2, -1) | (-3, 4) | ≈ 7.07 |
| (0, 0) | (1, 1) | ≈ 1.41 |
| (-4, 2) | (5, 2) | 9 |
Why it works
Draw a horizontal line from the first point and a vertical line from the second; they meet at a right angle. The horizontal side is (x₂ − x₁), the vertical side is (y₂ − y₁), and the distance is the hypotenuse. That’s exactly the Pythagorean theorem, a² + b² = c².
Distance in 3D
Add a third term for the z-values: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²). From (1, 2, 3) to (4, 6, 15): √(9 + 16 + 144) = √169 = 13.
Related formulas
- Halfway point between two points: see the midpoint formula.
- Steepness of the line between them: see the slope formula.
- On maps, the same idea gives straight-line distance on a grid, though real-world distances over the Earth’s curve need different formulas.
Frequently asked questions
What is the distance formula?
d = √((x₂ − x₁)² + (y₂ − y₁)²).
What is the distance between (0, 0) and (3, 4)?
5.
Does the order of the points matter?
No. Squaring the differences gives the same result either way.
How is the distance formula related to Pythagoras?
It’s the Pythagorean theorem applied to the horizontal and vertical gaps between the points.
