Free lesson

Every lesson is free, no account needed. Make a free account to save your progress.

Live classGet practice + mocks
  1. Home
  2. Lesson Library
  3. The distance formula
UPCAT Math Review · Coordinate geometry

The Distance Formula

Pythagoras wearing coordinates — nothing more.

The problem

How far apart are (−3, 2) and (5, 8)?

Draw the right triangle hiding in the grid.

(−3, 2) (5, 8) 8 across 6 up d = ?

across = 5 − (−3) = 8

the x-difference

up = 8 − 2 = 6

the y-difference

The two points are the ends of a hypotenuse. The legs run along the grid, so their lengths are just subtractions.

The formula is Pythagoras, relabelled.

d = √ (x₂ − x₁)² + (y₂ − y₁)²

a² + b² = c²

the theorem

the same thing

a and b are the two differences

If you ever forget it, sketch the triangle and use Pythagoras directly.

Substitute, carefully.

d = √ (5 − (−3))² + (8 − 2)²

brackets round each difference

= √ 8² + 6²

minus a minus adds

= √ 64 + 36

square them

= √100 = 10

the 3-4-5 triple, doubled

d = 10 units

Squares before adding

√64 + 36 is √100 = 10. It is not √64 + √36 = 14. A square root never splits across a plus.

The order of the points does not matter.

(−3 − 5)² = (−8)² = 64

reversed

(5 − (−3))² = 8² = 64

the original

Squaring destroys the sign, so distance is the same in either direction.

That is the difference from slope, where the order does matter — a reversed slope changes sign, but a reversed distance does not.

Backwards: the distance is given, a coordinate is missing.

The distance from (2, k) to (−3, 1) is 13. Find k.

(2 − (−3))² + (k − 1)² = 13²

square both sides — no root to carry

25 + (k − 1)² = 169

the known leg is 5

(k − 1)² = 144

the missing leg squared

k − 1 = 12 or k − 1 = −12

a square root has two signs

k = 13 or k = −11

one point above, one below

Two answers, then read the condition

The point can sit 12 above or 12 below y = 1, so there are always two values. The question then picks one with a condition such as "k > 0" or "in the second quadrant". Taking only +12 and stopping is the usual slip.

Equally far from two points. A point P on the y-axis is the same distance from (3, 1) as from (5, 3). Find P.

P = (0, k)

on the y-axis, x is 0 (on the x-axis, y is 0)

(0 − 3)² + (k − 1)² = (0 − 5)² + (k − 3)²

set the two squared distances equal

9 + k² − 2k + 1 = 25 + k² − 6k + 9

expand both brackets

4k = 24, so k = 6

the k² cancels — it is linear

P = (0, 6)

check: 9 + 25 = 34 and 25 + 9 = 34 ✓

Variations: a root that does not come out, a level pair, fractions.

Not a perfect square. How far is (−1, 4) from (3, −2)?

d = √ (3 − (−1))² + (−2 − 4)²

brackets round each difference

= √ 4² + (−6)² = √16 + 36

the minus dies when squared

= √52 = √4 × 13

pull out the biggest square factor

= 2√13

about 7.2

What is different: 52 is not a square number, so the answer stays a simplified root — the choices will show 2√13, not a decimal.

Only the square factor comes out

√52 = √4 × √13 = 2√13. Writing 4√13 brings out the 4 itself instead of its root, and 2√26 splits 52 as 2 × 26, where 2 is not a square.

Two points at the same height. How far is (−7, 3) from (2, 3)?

up = 3 − 3 = 0

same y: the segment is level

d = √ 9² + 0² = √81

the formula still works

= 9

the same as 2 − (−7)

What is different: one difference is 0, so there is no triangle — the distance is just the other difference, made positive.

Fractions. How far is (½, −1) from (2, 1)?

across = 2 − ½ = 32,  up = 1 − (−1) = 2

the two legs

d = √ (32)² + 2² = √ 94 + 164

write 4 as 164 to add

= √254

one fraction under the root

= 52 = 2½

root the top and the bottom

What is different: square the fraction whole — (32)² is 94, not 92 — and put both squares over the same denominator before adding.

What it gets used for.

Question What to do
perimeter of a triangle from its verticesthree distances, added
is the triangle isosceles?compare the three lengths
is the triangle right-angled?test a² + b² = c² on the lengths
radius of a circledistance from centre to a point on it
which point is nearer?compare distances — no need to root

For that last one, comparing the values under the root is enough. The bigger square is the bigger distance.

Worked: classify the triangle with vertices A(5, 2), B(1, 1) and C(0, 5).

AB² = 4² + 1² = 17

keep the squares

BC² = 1² + 4² = 17

AB = BC, so isosceles

AC² = 5² + 3² = 34

the longest side

17 + 17 = 34 ✓

Pythagoras holds, so right-angled at B

isosceles right triangle

On the exam

Distance questions rarely stop at one length: they ask for a missing coordinate, the farthest point, or what kind of triangle three points make. Work with the squared distances throughout — compare them, test a² + b² = c² on them — and only take a root if the answer needs a length.

Check: count the squares.

on the grid 8 right, 6 up matches the subtractions ✓
Pythagoras 64 + 36 = 100 √100 = 10 ✓
sensible? 10 > 8 and 10 > 6 the hypotenuse is longest ✓

Remember the flow

Subtract · Square · Add · Root

The hypotenuse must beat both legs.
Now you try

Practice problem

Find the distance

Find the distance between (1, −4) and (−5, 4).