Distance and midpoint¶
Geometry · level 6, lesson 3 of 6
A question to start¶
Two friends live at the points \((1, 2)\) and \((7, 10)\) on a town map whose grid squares are 1 km wide. They want to meet exactly halfway, and they want to know how far apart they are, as the crow flies.
You could draw the map carefully and use a ruler. But the coordinates already know the answer. The halfway point is found by averaging: \((4, 6)\). The distance is found by Pythagoras: exactly 10 km. In this lesson you will see why both rules work and use them to test shapes, check circles and find hidden points, all without drawing a single thing to scale.
The idea¶
Distance is Pythagoras on a grid¶
Take two points, \(A(x_1, y_1)\) and \(B(x_2, y_2)\). (The small numbers below the letters are subscripts: \(x_1\) is just a name, "the \(x\) of the first point".) Draw a horizontal line from \(A\) and a vertical line from \(B\). They meet at a corner \(C\) with a right angle, because grid lines are perpendicular. Now \(AB\) is the hypotenuse of a right triangle.
The horizontal leg is the change in \(x\), \(x_2 - x_1\). The vertical leg is the change in \(y\), \(y_2 - y_1\). So
For the friends: across \(7 - 1 = 6\), up \(10 - 2 = 8\), and \(d = \sqrt{36 + 64} = \sqrt{100} = 10\) km.
Negative steps do no harm. If you go from \(B\) to \(A\) instead, the steps are \(-6\) and \(-8\). Squaring removes the sign: \((-6)^2 = 36\). So it does not matter which point you call "first". That is why the formula has squares and not plain differences: a length cannot be negative, and squaring takes care of it.
Horizontal or vertical segments are the special case where one step is 0: the distance from \((2, 5)\) to \((9, 5)\) is just \(9 - 2 = 7\).
The midpoint is an average¶
The midpoint \(M\) of \(AB\) is the point exactly halfway along it. Its rule is:
In words: average the \(x\)'s and average the \(y\)'s.
Why. Halfway along the slanted segment should mean halfway across and halfway up. To check it, look at the picture: the dashed lines from \(M\) cut the big triangle into two small right triangles, \(A\) to \((4, 2)\) to \(M\), and \(M\) to \((7, 6)\) to \(B\). Each has legs 3 across and 4 up, with a right angle between them, so by SAS (level 5, lesson 5) they are congruent, and their hypotenuses \(AM\) and \(MB\) are equal. So \(M\) really is the midpoint. Halfway across from \(x_1\) to \(x_2\) is \(x_1 + \tfrac12(x_2 - x_1)\), which simplifies to \(\tfrac12(x_1 + x_2)\), the average.
Other fractions of the way¶
The same idea finds a point any fraction of the way along. To go \(\tfrac13\) of the way from \(A\) to \(B\), take \(\tfrac13\) of each step: from \(A(1, 2)\) to \(B(10, 14)\) the steps are 9 across and 12 up, so a third of the way is \((1 + 3,\ 2 + 4) = (4, 6)\).
Three ways to use distance¶
Testing shapes. Find all the side lengths, then use what you know: two equal sides mean isosceles; all equal means equilateral; and the converse of Pythagoras (lesson 1) tests for a right angle. When you only need to compare lengths, compare the squared distances and skip the square roots.
Circles. A circle with centre \((a, b)\) and radius \(r\) is all the points at distance \(r\) from the centre. A point \((x, y)\) is on the circle if \((x - a)^2 + (y - b)^2 = r^2\), inside if it is less, outside if it is more. (Level 7 turns this into the equation of a circle.)
Equal distances. The points equally far from \(A\) and \(B\) make the perpendicular bisector of \(AB\) (level 5, lesson 1), which always passes through the midpoint.
In three dimensions¶
In space a point has three coordinates \((x, y, z)\), the third one for height. The box-diagonal rule from lesson 2 becomes the 3D distance formula:
Worked examples¶
1. A distance with negatives. From \((-3, 5)\) to \((9, 0)\).
- Across: \(9 - (-3) = 12\). Up: \(0 - 5 = -5\).
- \(d = \sqrt{12^2 + (-5)^2} = \sqrt{144 + 25} = \sqrt{169} = 13\).
2. A midpoint. Of \((-4, 7)\) and \((10, -1)\): \(\left(\dfrac{-4 + 10}{2}, \dfrac{7 + (-1)}{2}\right) = (3, 3)\).
3. Finding the other end. \(M(2, 5)\) is the midpoint of \(AB\), and \(A = (-1, 3)\). Find \(B\).
- From \(A\) to \(M\) is \(2 - (-1) = 3\) across and \(5 - 3 = 2\) up.
- \(B\) is the same step again beyond \(M\): \((2 + 3,\ 5 + 2) = (5, 7)\).
- Check: the average of \(-1\) and \(5\) is \(2\), and of \(3\) and \(7\) is \(5\).
4. What kind of triangle? \(A(1, 1)\), \(B(5, 3)\), \(C(3, 7)\).
- \(AB^2 = 4^2 + 2^2 = 20\). \(BC^2 = (-2)^2 + 4^2 = 20\). \(AC^2 = 2^2 + 6^2 = 40\).
- \(AB = BC\), so it is isosceles.
- \(AB^2 + BC^2 = 20 + 20 = 40 = AC^2\), so by the converse of Pythagoras the angle at \(B\) is a right angle.
- It is an isosceles right triangle: half a square.
5. On the circle or not? A circle has centre \((2, -1)\) and radius 5.
- \((5, 3)\): \((5 - 2)^2 + (3 + 1)^2 = 9 + 16 = 25 = 5^2\). On the circle.
- \((6, 1)\): \(4^2 + 2^2 = 20 < 25\). Inside.
6. A rover's drive. On a map of a crater floor with 1 km grid squares, a rover is at \((2, 3)\) and a rock it wants to sample is at \((14, 8)\). The straight-line distance is \(\sqrt{12^2 + 5^2} = \sqrt{169} = 13\) km. Halfway, where it might stop to recharge, is \((8, 5.5)\).
Try it¶
- Find the distance from \((2, 3)\) to \((8, 11)\).
- Find the distance from \((-5, -2)\) to \((7, 3)\).
- Find the midpoint of \((-6, 4)\) and \((2, -8)\).
- \(M(1, -2)\) is the midpoint of \(AB\) and \(A = (4, 3)\). Find \(B\).
- Is the triangle \((0, 0)\), \((4, 0)\), \((2, 5)\) isosceles? Find all three sides.
- Show that \(O(0, 0)\), \(A(3, 4)\), \(B(-4, 3)\) make an isosceles right triangle. Where is the right angle?
- Find the exact distance from \((1, 1)\) to \((4, 7)\) in simplest form, and to two decimal places.
- Harder: find every point on the \(x\)-axis that is exactly 10 units from \((3, 8)\).
Answers
- Across 6, up 8: \(\sqrt{36 + 64} = 10\).
- Across 12, up 5: \(\sqrt{144 + 25} = 13\).
- \(\left(\dfrac{-6 + 2}{2}, \dfrac{4 - 8}{2}\right) = (-2, -2)\).
- From \(A\) to \(M\): \(1 - 4 = -3\) across, \(-2 - 3 = -5\) up. Again from \(M\): \(B = (1 - 3,\ -2 - 5) = (-2, -7)\).
- Base from \((0, 0)\) to \((4, 0)\): 4. From \((0, 0)\) to \((2, 5)\): \(\sqrt{4 + 25} = \sqrt{29}\). From \((4, 0)\) to \((2, 5)\): \(\sqrt{4 + 25} = \sqrt{29}\). Two equal sides: yes, isosceles.
- \(OA^2 = 9 + 16 = 25\), \(OB^2 = 16 + 9 = 25\), so \(OA = OB = 5\). \(AB^2 = 7^2 + 1^2 = 50 = 25 + 25\). By the converse of Pythagoras the right angle is at \(O\), opposite \(AB\). (\(B\) is \(A\) turned a quarter turn about \(O\), the rule \((x, y) \to (-y, x)\) from level 5.)
- \(\sqrt{3^2 + 6^2} = \sqrt{45} = \sqrt{9 \times 5} = 3\sqrt5 \approx 6.71\).
- A point on the \(x\)-axis is \((x, 0)\). Its distance squared from \((3, 8)\) is \((x - 3)^2 + 64\), which must be \(100\). So \((x - 3)^2 = 36\), and \(x - 3 = 6\) or \(x - 3 = -6\). The points are \((9, 0)\) and \((-3, 0)\). (The circle of radius 10 around \((3, 8)\) crosses the axis twice.)
Common mistake¶
Subtracting inside the midpoint. The midpoint adds and halves: \(\tfrac12(x_1 + x_2)\). The distance subtracts. Mixing them up gives nonsense, such as a "midpoint" outside the segment.
Losing a minus sign. From \(-3\) to \(9\) is \(9 - (-3) = 12\), not 6. Write the subtraction out with brackets around negative numbers before you calculate.
Where it leads¶
- Previous lesson: Using Pythagoras.
- Next lesson: Pi and the circumference.
- How steep the segment \(AB\) is, and its equation: lesson 6, slope.
- Equations of circles from the distance formula: level 7; distance between vectors: level 8.
- Graphs and coordinates: Algebra.
- This level: Level 6: Pythagoras and circles.