Distance Formula
290. The Distance Formula · measuring straight lines on a grid
The distance between A and B always equals √((x₂–x₁)² + (y₂–y₁)²).
The distance between two points A(x₁, y₁) and B(x₂, y₂) is √[(x₂ − x₁)² + (y₂ − y₁)²]. It comes straight from Pythagoras, applied to the right triangle whose legs are the horizontal and vertical gaps.
What this lesson covers
Try to break it
Drag A and B anywhere. The horizontal leg |x₂ − x₁| and the vertical leg |y₂ − y₁| change with them, and the distance √((x₂−x₁)² + (y₂−y₁)²) is the hypotenuse of that right triangle. Align A and B on the same x and the formula collapses to |y₂ − y₁|; align them on the same y and it collapses to |x₂ − x₁|.
How you build it
Construct the right triangle whose hypotenuse is the distance from A to B.
- Plot A = (-4, -2): from O count 4 left, then 2 down. Click that grid point.
- Plot B = (4, 2): from O count 4 right, then 2 up. Click that grid point.
- Plot C = (4, -2) — directly below B and level with A. This is the right-angle corner of the triangle.
- Draw the leg from A to C. It runs flat along y = -2, so its length is the x-gap, |x₂ − x₁| = 8.
- Draw the leg from C to B. It runs straight up at x = 4, so its length is the y-gap, |y₂ − y₁| = 4.
- Draw the hypotenuse from A to B. By Pythagoras, AB² = AC² + BC², so d = √(8² + 4²) = √80 ≈ 8.9 — the distance formula.
The proof, step by step
Prove that the distance between two points is √((x₂−x₁)² + (y₂−y₁)²).
- Identify the horizontal leg AC = |x₂ – x₁|.
- Identify the vertical leg BC = |y₂ – y₁|.
- Apply Pythagoras' Theorem: AB² = AC² + BC².
- Conclude AB = √((x₂ – x₁)² + (y₂ – y₁)²).
Worked example
In a Cartesian plane, point P is at (2, 3) and point Q is at (8, 11). What is the distance between P and Q?
Using the distance formula: PQ = √((8–2)² + (11–3)²) = √(36 + 64) = √100 = 10 units.
- 8 units
- 10 units — correct
- 12 units
- 14 units