The distance formula
A shortcut across a field is shorter than walking round two sides.
Loading lab…
- Two points: (1, 2) and (4, 6).
- A corner point: (4, 2).
- Across leg: 3.
- Up leg: 4.
- Straight-line distance: 5.
The rule
Two points give a right triangle. Its short sides are the two gaps between the points. The across gap is the difference of the abscissas (x-values). The up gap is the difference of the ordinates (y-values). The distance is its long side. Call the points (x₁, y₁) and (x₂, y₂).
Square both gaps. Add them. Take the square root.
Distance formula: distance = √((x₂ − x₁)² + (y₂ − y₁)²).
Pythagoras says why: in a right triangle, long² = short² + short². Squaring removes any minus sign.
Take (1, 2) and (4, 6). The gaps are 4 − 1 = 3 and 6 − 2 = 4. Then 9 + 16 = 25, and √25 = 5.
The origin is (0, 0). For (x, y), the distance from the origin is √(x² + y²).
| Two points | Gaps | Squares add to | Distance |
|---|---|---|---|
| (1, 1), (9, 7) | 8, 6 | 64 + 36 = 100 | 10 |
| (0, 0), (4, 7) | 4, 7 | 16 + 49 = 65 | √65 |
| (0, 5), (5, 0) | 5, 5 | 25 + 25 = 50 | 5√2 |
A root like √65 is not a fraction. It is a surd, and it is the exact answer. Take out a square factor when you can: √50 = √(25 × 2) = 5√2.
Three points are collinear when they lie on one line. Then the two shorter distances add to the longest. Take A(0, 0), B(1, 2) and C(3, 6). AB = √(1 + 4) = √5. BC = √(4 + 16) = 2√5. AC = √(9 + 36) = 3√5. So AB + BC = AC, and they are collinear.
A missing coordinate comes from the same formula. Find k when (2, k) is 5 units from (−1, 3). The gaps are 3 and k − 3. So 9 + (k − 3)² = 25, and (k − 3)² = 16. Then k − 3 = 4 or −4, because both square to 16. That gives k = 7 or −1.
Watch out!
Do not add the gaps. Take (0, 5) and (5, 0). The sum 5 + 5 = 10 is the walk round the corner. The straight distance is 5√2.