The straight-line distance between any two points
Show on a big screenA crow can fly straight. A path along streets cannot.
- Two points: (2, 1) and (8, 9).
- A third point, sharing a coordinate with each: (8, 1).
- Horizontal leg, the across gap: 6.
- Vertical leg, the up gap: 8.
- Hypotenuse, the longest side: the distance is 10.
Try it first. Pick a pair. Read the two gaps, then the distance.
Loading lab…
The rule
Two points that share no coordinate have a right triangle between them. The two gaps are its legs. The distance is its longest side. Count the across gap and the up gap. Square both gaps, then add them. Take the square root of the total. That is the distance.
A helper point is the third corner. It copies the across count of one point. It copies the up count of the other. One leg runs across, one runs up. They meet at 90°.
Take (2, 1) and (8, 9). The across gap is 8 − 2 = 6. The up gap is 9 − 1 = 8. Square both: 36 and 64. Add: 36 + 64 = 100. The distance is 10, since 10 × 10 = 100. If the points share a coordinate, one gap is 0. The distance is the other gap.
| The two points | Across gap | Up gap | Squares add to | Distance |
|---|---|---|---|---|
| (2, 1) and (8, 9) | 6 | 8 | 36 + 64 = 100 | 10 |
| (−4, −3) and (4, 12) | 8 | 15 | 64 + 225 = 289 | 17 |
| (0, 0) and (2, 3) | 2 | 3 | 4 + 9 = 13 | between 3 and 4 |
In the last row, 13 lies between 9 and 16. As 3² = 9 and 4² = 16, the distance is more than 3. It is less than 4. Not every distance is a whole number.
Watch out!
The two gaps added give 6 + 8 = 14. That is the walk round the corner. The straight line is 10.
Try the lab to finish this lesson.