When two points lie on the same horizontal or vertical line, the distance between them is just a difference of coordinates. But most pairs of points are not lined up like that. The distance formula finds the distance between any two points from their coordinates, and it comes straight from Pythagoras' theorem. With it we can test triangles for being isosceles or right-angled, check whether points lie on a line, and find unknown coordinates.
Let A ( x 1 , y 1 ) A(x_1, y_1) A ( x 1 , y 1 ) and B ( x 2 , y 2 ) B(x_2, y_2) B ( x 2 , y 2 ) be two points. Through A A A draw a horizontal line and through B B B a vertical line; they meet at C ( x 2 , y 1 ) C(x_2, y_1) C ( x 2 , y 1 ) .
A C AC A C is horizontal, so its length is ∣ x 2 − x 1 ∣ |x_2 - x_1| ∣ x 2 − x 1 ∣ .
B C BC B C is vertical, so its length is ∣ y 2 − y 1 ∣ |y_2 - y_1| ∣ y 2 − y 1 ∣ .
The angle at C C C is a right angle.
By Pythagoras' theorem, A B 2 = A C 2 + B C 2 AB^2 = AC^2 + BC^2 A B 2 = A C 2 + B C 2 , so
A B = ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2 AB = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} A B = ( x 2 − x 1 ) 2 + ( y 2 − y 1 ) 2
Because the differences are squared, it does not matter which point you call the first. In particular, the distance of a point ( x , y ) (x, y) ( x , y ) from the origin is x 2 + y 2 \sqrt{x^2 + y^2} x 2 + y 2 .
Example 1#
Find the distance between ( 2 , 3 ) (2, 3) ( 2 , 3 ) and ( 8 , 11 ) (8, 11) ( 8 , 11 ) .
d = ( 8 − 2 ) 2 + ( 11 − 3 ) 2 = 36 + 64 = 100 = 10 d = \sqrt{(8 - 2)^2 + (11 - 3)^2} = \sqrt{36 + 64} = \sqrt{100} = 10 d = ( 8 − 2 ) 2 + ( 11 − 3 ) 2 = 36 + 64 = 100 = 10
Example 2#
Find the distance between ( − 1 , − 2 ) (-1, -2) ( − 1 , − 2 ) and ( 4 , 10 ) (4, 10) ( 4 , 10 ) .
d = ( 4 − ( − 1 ) ) 2 + ( 10 − ( − 2 ) ) 2 = 5 2 + 12 2 = 25 + 144 = 169 = 13 d = \sqrt{(4 - (-1))^2 + (10 - (-2))^2} = \sqrt{5^2 + 12^2} = \sqrt{25 + 144} = \sqrt{169} = 13 d = ( 4 − ( − 1 ) ) 2 + ( 10 − ( − 2 ) ) 2 = 5 2 + 1 2 2 = 25 + 144 = 169 = 13
Put brackets round negative coordinates when you subtract them: 4 − ( − 1 ) = 5 4 - (-1) = 5 4 − ( − 1 ) = 5 , not 3 3 3 .
Example 3#
How far is the point ( − 5 , 12 ) (-5, 12) ( − 5 , 12 ) from the origin?
( − 5 ) 2 + 12 2 = 25 + 144 = 13 \sqrt{(-5)^2 + 12^2} = \sqrt{25 + 144} = 13 ( − 5 ) 2 + 1 2 2 = 25 + 144 = 13
Testing triangles#
Find all three sides, then compare them.
Example 4#
Show that A ( 1 , 1 ) A(1, 1) A ( 1 , 1 ) , B ( 4 , 5 ) B(4, 5) B ( 4 , 5 ) and C ( 8 , 2 ) C(8, 2) C ( 8 , 2 ) are the vertices of an isosceles right-angled triangle.
A B 2 = ( 4 − 1 ) 2 + ( 5 − 1 ) 2 = 9 + 16 = 25 AB^2 = (4 - 1)^2 + (5 - 1)^2 = 9 + 16 = 25 A B 2 = ( 4 − 1 ) 2 + ( 5 − 1 ) 2 = 9 + 16 = 25
B C 2 = ( 8 − 4 ) 2 + ( 2 − 5 ) 2 = 16 + 9 = 25 BC^2 = (8 - 4)^2 + (2 - 5)^2 = 16 + 9 = 25 B C 2 = ( 8 − 4 ) 2 + ( 2 − 5 ) 2 = 16 + 9 = 25
A C 2 = ( 8 − 1 ) 2 + ( 2 − 1 ) 2 = 49 + 1 = 50 AC^2 = (8 - 1)^2 + (2 - 1)^2 = 49 + 1 = 50 A C 2 = ( 8 − 1 ) 2 + ( 2 − 1 ) 2 = 49 + 1 = 50
A B = B C = 5 AB = BC = 5 A B = B C = 5 , so the triangle is isosceles. Also A B 2 + B C 2 = 25 + 25 = 50 = A C 2 AB^2 + BC^2 = 25 + 25 = 50 = AC^2 A B 2 + B C 2 = 25 + 25 = 50 = A C 2 , so by the converse of Pythagoras' theorem the angle at B B B is a right angle.
Working with squared distances avoids square roots until the very end.
Testing for collinear points#
Points are collinear if they lie on one straight line. Three points A A A , B B B , C C C are collinear exactly when the longest of the three distances equals the sum of the other two.
Example 5#
Are A ( 1 , 2 ) A(1, 2) A ( 1 , 2 ) , B ( 3 , 6 ) B(3, 6) B ( 3 , 6 ) and C ( 4 , 8 ) C(4, 8) C ( 4 , 8 ) collinear?
A B = 4 + 16 = 20 = 2 5 , B C = 1 + 4 = 5 , A C = 9 + 36 = 45 = 3 5 AB = \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} A B = 4 + 16 = 20 = 2 5 , B C = 1 + 4 = 5 , A C = 9 + 36 = 45 = 3 5
A B + B C = 2 5 + 5 = 3 5 = A C AB + BC = 2\sqrt{5} + \sqrt{5} = 3\sqrt{5} = AC A B + B C = 2 5 + 5 = 3 5 = A C , so the points are collinear.
Finding unknown coordinates#
Example 6#
The distance between ( x , 3 ) (x, 3) ( x , 3 ) and ( 2 , − 1 ) (2, -1) ( 2 , − 1 ) is 5 5 5 . Find x x x .
( x − 2 ) 2 + ( 3 − ( − 1 ) ) 2 = 25 ( x − 2 ) 2 + 16 = 25 ( x − 2 ) 2 = 9 x − 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} ( x − 2 ) 2 + ( 3 − ( − 1 ) ) 2 ( x − 2 ) 2 + 16 ( x − 2 ) 2 x − 2 = 25 = 25 = 9 = ± 3
So x = 5 x = 5 x = 5 or x = − 1 x = -1 x = − 1 . Both answers are correct: there are two such points.
Example 7#
Find the point on the x-axis that is equidistant from A ( 2 , 5 ) A(2, 5) A ( 2 , 5 ) and B ( − 2 , 9 ) B(-2, 9) B ( − 2 , 9 ) .
A point on the x-axis has the form P ( x , 0 ) P(x, 0) P ( x , 0 ) . Set P A 2 = P B 2 PA^2 = PB^2 P A 2 = P B 2 :
( x − 2 ) 2 + 25 = ( x + 2 ) 2 + 81 x 2 − 4 x + 4 + 25 = x 2 + 4 x + 4 + 81 − 8 x = 56 x = − 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} ( x − 2 ) 2 + 25 x 2 − 4 x + 4 + 25 − 8 x x = ( x + 2 ) 2 + 81 = x 2 + 4 x + 4 + 81 = 56 = − 7
The point is ( − 7 , 0 ) (-7, 0) ( − 7 , 0 ) . Check: P A 2 = 81 + 25 = 106 PA^2 = 81 + 25 = 106 P A 2 = 81 + 25 = 106 and P B 2 = 25 + 81 = 106 PB^2 = 25 + 81 = 106 P B 2 = 25 + 81 = 106 .
Practice#
Find the distance between ( 3 , 4 ) (3, 4) ( 3 , 4 ) and ( 6 , 8 ) (6, 8) ( 6 , 8 ) .
Find the distance between ( − 2 , 5 ) (-2, 5) ( − 2 , 5 ) and ( 4 , − 3 ) (4, -3) ( 4 , − 3 ) .
Find the distance of ( 7 , − 24 ) (7, -24) ( 7 , − 24 ) from the origin.
Find the distance between ( a , b ) (a, b) ( a , b ) and ( − a , − b ) (-a, -b) ( − a , − b ) .
The point ( 2 , y ) (2, y) ( 2 , y ) is at a distance 10 10 10 from ( 8 , 4 ) (8, 4) ( 8 , 4 ) . Find y y y .
Find the point on the y-axis that is equidistant from ( 6 , 5 ) (6, 5) ( 6 , 5 ) and ( − 4 , 3 ) (-4, 3) ( − 4 , 3 ) .
Show that ( 0 , 0 ) (0, 0) ( 0 , 0 ) , ( 3 , 0 ) (3, 0) ( 3 , 0 ) and ( 3 , 4 ) (3, 4) ( 3 , 4 ) form a right-angled triangle, and find its perimeter.
Are the points ( − 1 , − 1 ) (-1, -1) ( − 1 , − 1 ) , ( 2 , 3 ) (2, 3) ( 2 , 3 ) and ( 8 , 11 ) (8, 11) ( 8 , 11 ) collinear?
Show that ( 0 , 0 ) (0, 0) ( 0 , 0 ) , ( 2 , 0 ) (2, 0) ( 2 , 0 ) and ( 1 , 3 ) (1, \sqrt{3}) ( 1 , 3 ) are the vertices of an equilateral triangle.
A circle has centre ( 2 , − 3 ) (2, -3) ( 2 , − 3 ) and passes through ( 5 , 1 ) (5, 1) ( 5 , 1 ) . Find its radius.
Answers#
Show answers
9 + 16 = 5 \sqrt{9 + 16} = 5 9 + 16 = 5
36 + 64 = 10 \sqrt{36 + 64} = 10 36 + 64 = 10
49 + 576 = 625 = 25 \sqrt{49 + 576} = \sqrt{625} = 25 49 + 576 = 625 = 25
( 2 a ) 2 + ( 2 b ) 2 = 2 a 2 + b 2 \sqrt{(2a)^2 + (2b)^2} = 2\sqrt{a^2 + b^2} ( 2 a ) 2 + ( 2 b ) 2 = 2 a 2 + b 2
36 + ( y − 4 ) 2 = 100 36 + (y - 4)^2 = 100 36 + ( y − 4 ) 2 = 100 , so y − 4 = ± 8 y - 4 = \pm 8 y − 4 = ± 8 and y = 12 y = 12 y = 12 or y = − 4 y = -4 y = − 4 .
With P ( 0 , y ) P(0, y) P ( 0 , y ) : 36 + ( y − 5 ) 2 = 16 + ( y − 3 ) 2 36 + (y - 5)^2 = 16 + (y - 3)^2 36 + ( y − 5 ) 2 = 16 + ( y − 3 ) 2 gives 61 − 10 y = 25 − 6 y 61 - 10y = 25 - 6y 61 − 10 y = 25 − 6 y , so y = 9 y = 9 y = 9 . The point is ( 0 , 9 ) (0, 9) ( 0 , 9 ) .
Sides 3 3 3 , 4 4 4 and 5 5 5 , and 3 2 + 4 2 = 5 2 3^2 + 4^2 = 5^2 3 2 + 4 2 = 5 2 ; perimeter 12 12 12 .
Distances 5 5 5 , 10 10 10 and 15 15 15 , and 5 + 10 = 15 5 + 10 = 15 5 + 10 = 15 : yes, collinear.
Each side is 2 2 2 : 4 = 2 \sqrt{4} = 2 4 = 2 , 1 + 3 = 2 \sqrt{1 + 3} = 2 1 + 3 = 2 , 1 + 3 = 2 \sqrt{1 + 3} = 2 1 + 3 = 2 .
9 + 16 = 5 \sqrt{9 + 16} = 5 9 + 16 = 5