Horizontal and vertical segments by subtraction, then the distance formula from the Baudhāyana–Pythagoras theorem; why signs never matter; testing triangles for isosceles, right-angled and collinear; points on a circle; and the midpoint formula.
Lesson 2 of 3
5 min read
8 practice questions
The idea in one breath
If two points lie on the same horizontal or vertical line, finding the distance between them is easy. You just subtract. For any other pair, there is a neat trick. The segment joining them is the hypotenuse of a right triangle whose legs are horizontal and vertical, and the Baudhāyana–Pythagoras theorem does the rest. In this lesson you will build the formula, see why the signs of the differences never matter, and then use it to test shapes and to find a midpoint.
Horizontal and vertical segments
If two points share a y-coordinate, the segment between them is horizontal and its length is the difference of the x-coordinates. From (2,5) to (9,5), for example, the length is 9−2=7. It works the same way when the x-coordinate is shared. From (4,−3) to (4,6) the length is 6−(−3)=9.
Take the larger minus the smaller, or find the difference and drop the sign. Either way, remember that a length is never negative.
A slanted segment
Let us try A(2,3) and B(8,11). Walk from A horizontally to the point C(8,3) directly below B, then vertically up to B. Triangle ACB is right-angled at C, with
AC=8−2=6,CB=11−3=8
and so, by the Baudhāyana–Pythagoras theorem,
AB=62+82=36+64=100=10
The legs 6 and 8 give the distance AB = 10.
The distance formula
For P(x1,y1) and Q(x2,y2), the horizontal leg is x2−x1 and the vertical leg is y2−y1, so
PQ=(x2−x1)2+(y2−y1)2
Here is why you need not worry about signs. Squaring removes any minus sign, so it does not matter which point you call P and which you call Q, or whether the coordinates are negative. If you reflect the whole picture in an axis, the signs change but the distances do not.
Example 1. Find the distance between (−3,4) and (5,−2).
(5−(−3))2+(−2−4)2=82+(−6)2=64+36=10
Example 2. Find the distance from the origin to (−7,24).
(−7)2+242=49+576=625=25
This is worth remembering on its own: the distance of (x,y) from the origin is always x2+y2.
Example 3. Find the three sides of the triangle with vertices D(1,2), E(7,2) and F(4,8).
Two sides come out equal, so the triangle is isosceles.
Triangle DEF has two equal sides, so it is isosceles.
Testing a shape
Once you can find distances, you can answer quite a few questions about a shape without drawing it.
Isosceles or equilateral: compare the three sides and see how many match.
Right-angled: check whether the squares of two sides add up to the square of the third.
Collinear: three points lie on one line exactly when the two shorter distances add up to the longest one.
Example 4. Are (−2,−1), (1,1) and (7,5) collinear?
9+4=13; 36+16=52=213; 81+36=117=313. Since 13+213=313, the answer is yes.
Example 5. Show that (3,0), (6,4) and (−1,3) form a right triangle.
Work with the squares of the sides: (3)2+(4)2=25; (7)2+(1)2=50; (4)2+(3)2=25. Since 25+25=50, the angle at (3,0) is a right angle. As a bonus, the two legs are equal, so it is a right isosceles triangle.
Example 6. Do (5,12), (−12,5) and (0,13) all lie on one circle centred at the origin?
Distances from O: 25+144=13, 144+25=13, 13. All three points are 13 from O, so yes, they lie on the circle of radius 13 centred at O.
The midpoint
Finding the point halfway along a segment is even easier. For the segment from (x1,y1) to (x2,y2), the coordinates of the halfway point are just the averages.
M=(2x1+x2,2y1+y2)
Why does this work? Going from the first point to the second, x changes by x2−x1. At the halfway mark it has changed by half of that, giving x1+2x2−x1=2x1+x2. The same reasoning works for y.
Example 7. Midpoint of (−4,9) and (6,−1): (2−4+6,29+(−1))=(1,4).
M(1, 4) is halfway from (-4, 9) to (6, -1).
Example 8.M(2,−3) is the midpoint of A(−5,1) and B. Find B.
2−5+x=2 gives x=9; 21+y=−3 gives y=−7. So B=(9,−7).
Practice
Find the distance between (a) (1,1) and (4,5); (b) (−6,2) and (6,−3); (c) (0,0) and (−9,−12).
Show that the triangle with vertices (0,3), (4,0) and (4,6) is isosceles.
Are (2,1), (5,3) and (11,7) collinear?
Show that (1,1), (4,1) and (1,5) are the vertices of a right triangle and find its hypotenuse.
Which of (−8,6), (9,4) and (0,−10) lie on the circle of radius 10 centred at the origin? Which is inside it?
Find the midpoint of (7,−2) and (−3,8).
M(0,5) is the midpoint of P(−6,2) and Q. Find Q.
The vertices of a square are (2,1), (−1,2), (−2,−1) and (1,−2) in order. Verify that all four sides are equal and that the two diagonals are equal, and find the area.
Answers
Show answers
(a) 5. (b) 144+25=13. (c) 15.
Sides: 16+9=5, 6, 16+9=5. Two equal sides.
13, 52=213, 117=313. Yes.
Sides 3, 4 and 5; 9+16=25. Hypotenuse 5, between (4,1) and (1,5).
Distances from O: 10, 97≈9.85, 10. The first and third are on the circle; (9,4) is inside.
(2,3).
Q=(6,8).
Every side is 9+1=10. Diagonals: (2,1) to (−2,−1) is 16+4=20; (−1,2) to (1,−2) is 4+16=20. Area =(10)2=10 square units.
Test yourself
Distance Between Two Points, Quiz
Five questions on the distance formula and the midpoint. Pick one answer for each.