The distance formula: d = √((x₂ − x₁)² + (y₂ − y₁)²). It gives the straight-line distance between any two points (x₁, y₁) and (x₂, y₂) in the coordinate plane. There is nothing to memorise beyond its shape: subtract the x's, subtract the y's, square both, add, and take the square root. It works for points in any position — same quadrant or different, positive coordinates or negative — because the squaring step erases every sign.
The Variables, Explained
- (x₁, y₁) is the first point and (x₂, y₂) the second. Unlike slope, the labelling truly does not matter: swapping the points flips both differences' signs, and the squares are unchanged.
- x₂ − x₁ is the horizontal change (the run) between the points.
- y₂ − y₁ is the vertical change (the rise).
- d is the distance itself — always zero or positive, never negative.
Why It Works: Pythagoras on the Legs
Plot the two points and complete a right triangle: draw a horizontal segment from the first point and a vertical segment from the second until they meet. The horizontal leg has length |x₂ − x₁| and the vertical leg |y₂ − y₁|, and the segment joining the two points is the hypotenuse. The Pythagorean theorem then says d² = (x₂ − x₁)² + (y₂ − y₁)², and taking the square root gives the distance formula. That is the whole derivation: the distance formula is not a new fact about coordinates, it is the oldest theorem in geometry applied to a grid. It also explains why the differences are squared — they are legs of a triangle — and why the final step is a root.
Worked Example: (1, 2) to (7, 10)
Horizontal change: 7 − 1 = 6. Vertical change: 10 − 2 = 8. Square and add: 6² + 8² = 36 + 64 = 100. Take the root: d = √100 = 10. Notice the 6-8-10 triangle — a scaled 3-4-5 — hiding inside the coordinates; whenever the two differences form a Pythagorean triple, the distance comes out whole. A quick sanity check: the distance must be longer than either leg alone (10 > 8 and 10 > 6 ✓) and shorter than the two legs walked together (10 < 14 ✓).
A Second Example, and the 3D Extension
From (0, 0) to (5, 12): differences 5 and 12, so d = √(25 + 144) = √169 = 13 — the 5-12-13 triple again. The same idea climbs into three dimensions by adding one more squared difference under the root: d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²). From (0, 0, 0) to (2, 3, 6): d = √(4 + 9 + 36) = √49 = 7. Each new dimension adds its leg to the same Pythagorean sum, which is why surveyors, game engines and GPS software all run this one formula underneath.
Common Mistakes
- Forgetting the final square root. 36 + 64 = 100 is d², not d. The answer is √100 = 10.
- Adding the squares' roots instead. √(36 + 64) is not √36 + √64 = 14 — that wrong move computes the walked path, not the straight line.
- Mixing coordinates. Each subtraction pairs like with like: x with x, y with y. (x₂ − y₁) has no meaning here.
- Squaring a negative carelessly. (2 − 7)² = (−5)² = 25, not −25. A squared difference is never negative, so if your sum under the root is negative, a sign slipped.
- Reporting a negative distance. Distance cannot be negative; if d comes out negative, the root step or a sign went wrong.
Check any pair of points in the distance formula calculator, read the standard treatment in OpenStax Elementary Algebra, and browse the full formulas library for more reference pages.