When two points lie on the same hor­i­zon­tal or ver­ti­cal line, the dis­tance between them is just a dif­fer­ence of coor­di­nates. But most pairs of points are not lined up like that. The dis­tance for­mula finds the dis­tance between any two points from their coor­di­nates, and it comes straight from Pythago­ras' the­o­rem. With it we can test tri­an­gles for being isosce­les or right-angled, check whether points lie on a line, and find unknown coor­di­nates.

Deriv­ing the for­mula

Let A(x1,y1)A(x_1, y_1) and B(x2,y2)B(x_2, y_2) be two points. Through AA draw a hor­i­zon­tal line and through BB a ver­ti­cal line; they meet at C(x2,y1)C(x_2, y_1).

  • ACAC is hor­i­zon­tal, so its length is ∣x2−x1∣|x_2 - x_1|.
  • BCBC is ver­ti­cal, so its length is ∣y2−y1∣|y_2 - y_1|.
  • The angle at CC is a right angle.

By Pythago­ras' the­o­rem, AB2=AC2+BC2AB^2 = AC^2 + BC^2, so

AB=(x2−x1)2+(y2−y1)2AB = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}

Because the dif­fer­ences are squared, it does not mat­ter which point you call the first. In par­tic­u­lar, the dis­tance of a point (x,y)(x, y) from the ori­gin is x2+y2\sqrt{x^2 + y^2}.

Exam­ple 1

Find the dis­tance between (2,3)(2, 3) and (8,11)(8, 11).

d=(8−2)2+(11−3)2=36+64=100=10d = \sqrt{(8 - 2)^2 + (11 - 3)^2} = \sqrt{36 + 64} = \sqrt{100} = 10

Exam­ple 2

Find the dis­tance between (−1,−2)(-1, -2) and (4,10)(4, 10).

d=(4−(−1))2+(10−(−2))2=52+122=25+144=169=13d = \sqrt{(4 - (-1))^2 + (10 - (-2))^2} = \sqrt{5^2 + 12^2} = \sqrt{25 + 144} = \sqrt{169} = 13

Put brack­ets round neg­a­tive coor­di­nates when you sub­tract them: 4−(−1)=54 - (-1) = 5, not 33.

Exam­ple 3

How far is the point (−5,12)(-5, 12) from the ori­gin?

(−5)2+122=25+144=13\sqrt{(-5)^2 + 12^2} = \sqrt{25 + 144} = 13

Test­ing tri­an­gles

Find all three sides, then com­pare them.

Exam­ple 4

Show that A(1,1)A(1, 1), B(4,5)B(4, 5) and C(8,2)C(8, 2) are the ver­tices of an isosce­les right-angled tri­an­gle.

AB2=(4−1)2+(5−1)2=9+16=25AB^2 = (4 - 1)^2 + (5 - 1)^2 = 9 + 16 = 25

BC2=(8−4)2+(2−5)2=16+9=25BC^2 = (8 - 4)^2 + (2 - 5)^2 = 16 + 9 = 25

AC2=(8−1)2+(2−1)2=49+1=50AC^2 = (8 - 1)^2 + (2 - 1)^2 = 49 + 1 = 50

AB=BC=5AB = BC = 5, so the tri­an­gle is isosce­les. Also AB2+BC2=25+25=50=AC2AB^2 + BC^2 = 25 + 25 = 50 = AC^2, so by the con­verse of Pythago­ras' the­o­rem the angle at BB is a right angle.

Work­ing with squared dis­tances avoids square roots until the very end.

Test­ing for collinear points

Points are collinear if they lie on one straight line. Three points AA, BB, CC are collinear exactly when the longest of the three dis­tances equals the sum of the other two.

Exam­ple 5

Are A(1,2)A(1, 2), B(3,6)B(3, 6) and C(4,8)C(4, 8) collinear?

AB=4+16=20=25,BC=1+4=5,AC=9+36=45=35AB = \sqrt{4 + 16} = \sqrt{20} = 2\sqrt{5}, \quad BC = \sqrt{1 + 4} = \sqrt{5}, \quad AC = \sqrt{9 + 36} = \sqrt{45} = 3\sqrt{5}

AB+BC=25+5=35=ACAB + BC = 2\sqrt{5} + \sqrt{5} = 3\sqrt{5} = AC, so the points are collinear.

Find­ing unknown coor­di­nates

Exam­ple 6

The dis­tance between (x,3)(x, 3) and (2,−1)(2, -1) is 55. Find xx.

(x−2)2+(3−(−1))2=25(x−2)2+16=25(x−2)2=9x−2=±3\begin{aligned} (x - 2)^2 + (3 - (-1))^2 &= 25 \\ (x - 2)^2 + 16 &= 25 \\ (x - 2)^2 &= 9 \\ x - 2 &= \pm 3 \end{aligned}

So x=5x = 5 or x=−1x = -1. Both answers are cor­rect: there are two such points.

Exam­ple 7

Find the point on the x-axis that is equidis­tant from A(2,5)A(2, 5) and B(−2,9)B(-2, 9).

A point on the x-axis has the form P(x,0)P(x, 0). Set PA2=PB2PA^2 = PB^2:

(x−2)2+25=(x+2)2+81x2−4x+4+25=x2+4x+4+81−8x=56x=−7\begin{aligned} (x - 2)^2 + 25 &= (x + 2)^2 + 81 \\ x^2 - 4x + 4 + 25 &= x^2 + 4x + 4 + 81 \\ -8x &= 56 \\ x &= -7 \end{aligned}

The point is (−7,0)(-7, 0). Check: PA2=81+25=106PA^2 = 81 + 25 = 106 and PB2=25+81=106PB^2 = 25 + 81 = 106.

Prac­tice

  1. Find the dis­tance between (3,4)(3, 4) and (6,8)(6, 8).
  2. Find the dis­tance between (−2,5)(-2, 5) and (4,−3)(4, -3).
  3. Find the dis­tance of (7,−24)(7, -24) from the ori­gin.
  4. Find the dis­tance between (a,b)(a, b) and (−a,−b)(-a, -b).
  5. The point (2,y)(2, y) is at a dis­tance 1010 from (8,4)(8, 4). Find yy.
  6. Find the point on the y-axis that is equidis­tant from (6,5)(6, 5) and (−4,3)(-4, 3).
  7. Show that (0,0)(0, 0), (3,0)(3, 0) and (3,4)(3, 4) form a right-angled tri­an­gle, and find its perime­ter.
  8. Are the points (−1,−1)(-1, -1), (2,3)(2, 3) and (8,11)(8, 11) collinear?
  9. Show that (0,0)(0, 0), (2,0)(2, 0) and (1,3)(1, \sqrt{3}) are the ver­tices of an equi­lat­eral tri­an­gle.
  10. A cir­cle has cen­tre (2,−3)(2, -3) and passes through (5,1)(5, 1). Find its radius.

Answers

Show answers
  1. 9+16=5\sqrt{9 + 16} = 5
  2. 36+64=10\sqrt{36 + 64} = 10
  3. 49+576=625=25\sqrt{49 + 576} = \sqrt{625} = 25
  4. (2a)2+(2b)2=2a2+b2\sqrt{(2a)^2 + (2b)^2} = 2\sqrt{a^2 + b^2}
  5. 36+(y−4)2=10036 + (y - 4)^2 = 100, so y−4=±8y - 4 = \pm 8 and y=12y = 12 or y=−4y = -4.
  6. With P(0,y)P(0, y): 36+(y−5)2=16+(y−3)236 + (y - 5)^2 = 16 + (y - 3)^2 gives 61−10y=25−6y61 - 10y = 25 - 6y, so y=9y = 9. The point is (0,9)(0, 9).
  7. Sides 33, 44 and 55, and 32+42=523^2 + 4^2 = 5^2; perime­ter 1212.
  8. Dis­tances 55, 1010 and 1515, and 5+10=155 + 10 = 15: yes, collinear.
  9. Each side is 22: 4=2\sqrt{4} = 2, 1+3=2\sqrt{1 + 3} = 2, 1+3=2\sqrt{1 + 3} = 2.
  10. 9+16=5\sqrt{9 + 16} = 5