Skip to content
Your progress

Checking your sign-in…

Who's learning?

Each profile keeps its own read lessons, badges, streak, and practice scores on this device.

Lesson 1 of 13

The distance formula

Show on a big screen

8 min

Text size

A shortcut across a field is shorter than walking round two sides.

Loading lab…

Two points: (1, 2) and (4, 6).
Step 1 of 5
  1. Two points: (1, 2) and (4, 6).
  2. A corner point: (4, 2).
  3. Across leg: 3.
  4. Up leg: 4.
  5. 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²).

Three pairs of points, each distance found the same way
Two pointsGapsSquares add toDistance
(1, 1), (9, 7)8, 664 + 36 = 10010
(0, 0), (4, 7)4, 716 + 49 = 65√65
(0, 5), (5, 0)5, 525 + 25 = 505√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.

Try the lab to finish this lesson.