Math Explainer.

Distance and midpoint: calculating with coordinates

Ages 14–16GCSE (G20a)

What you will learn

Between two points there is usually a hidden right-angled triangle. With it you work out the distance between the points without measuring. You also find the midpoint of a line segment.

Think first: what is left of the triangle when A and B are at the same height? How do you find the distance then? Then check: drag B to the height of A.

Two points A and B with the right-angled triangle between themA coordinate grid from −7 to 7 on both axes; the numbers from −6 to 6 are at the left and bottom edges of the grid. Drag the points A and B onto grid points from −6 to 6, move them with the arrow keys or type their coordinates into the boxes; they always stay at least 2 units apart. The segment AB is green. The two legs are drawn as dashed lines: a horizontal one from A and one from its end up or down to B, each labelled with its length; the right angle is marked in their corner. When A and B are at the same height or one directly above the other, there is no triangle. A small dark dot M marks the midpoint of the segment. Under the coordinate boxes is the calculation: the two differences, the distance d and the coordinates of the midpoint.
A
B
Δx=2−(−2)=4Δy=2−(−1)=3d=42+32=25=5xM=−2+22=0yM=−1+22=0.5\begin{aligned} \Delta x &= 2 - (-2) = 4 \\ \Delta y &= 2 - (-1) = 3 \\ d &= \sqrt{{4}^2 + {3}^2\rule[-0.25em]{0pt}{1em}} \\ &= \sqrt{25} = 5 \\ x_M &= \frac{-2 + 2\rule[-0.25em]{0pt}{1em}}{2} = 0 \\ y_M &= \frac{-1 + 2\rule[-0.25em]{0pt}{1em}}{2} = 0.5 \end{aligned}

From A(−2, −1) to B(2, 2): the horizontal leg has length 4 and the vertical leg has length 3. The distance is 5, and the midpoint is M(0, 0.5).

The hidden triangle

At the same height there is no triangle: the distance is how far apart the xx-coordinates are. One directly above the other, the yy-coordinates count instead.

Otherwise the horizontal path from A and the vertical path to B are the legs. Their lengths are the differences Δx=xB−xA\Delta x = x_B - x_A and Δy=yB−yA\Delta y = y_B - y_A; if one is negative, drop the minus sign. The distance dd is the hypotenuse:

d=(Δx)2+(Δy)2d = \sqrt{(\Delta x)^2 + (\Delta y)^2}

The horizontal leg is as long as the xx-coordinates are apart; the other leg is as long as the yy-coordinates are apart.

Self-check

Between A(−1,3)A(-1, 3) and B(4,5)B(4, 5) lies a right-angled triangle. How long is its horizontal leg?

Your answer
Show the solution

4−(−1)=4+1=54 - (-1) = 4 + 1 = 5. If you work out 4−1=34 - 1 = 3, you have lost the minus sign. And 5−3=25 - 3 = 2 is the other leg: how far apart the yy-coordinates are.

Example 1

How far apart are the points A(1,2)A(1, 2) and B(6,14)B(6, 14)?

  1. 01

    Work out the difference in the xx-coordinates: the horizontal leg.

    Δx=6−1=5\Delta x = 6 - 1 = 5
  2. 02

    Work out the difference in the yy-coordinates: the second leg.

    Δy=14−2=12\Delta y = 14 - 2 = 12
  3. 03

    Substitute both into the formula for the distance and square them.

    d=52+122=25+144d = \sqrt{5^2 + 12^2} = \sqrt{25 + 144}
  4. 04

    Add the squares and take the square root.

    d=169=13d = \sqrt{169} = 13
Answer

The distance is 1313 units. Check: 1313 is longer than each of the two legs and shorter than the detour along both, 5+12=175 + 12 = 17.

Self-check

What is the distance between the points A(−2,1)A(-2, 1) and B(4,9)B(4, 9)?

Show the solution

Δx=4−(−2)=6\Delta x = 4 - (-2) = 6 and Δy=9−1=8\Delta y = 9 - 1 = 8. So d=62+82=36+64=100=10d = \sqrt{6^2 + 8^2} = \sqrt{36 + 64} = \sqrt{100} = 10.

The midpoint

The midpoint MM of a segment lies exactly halfway between the endpoints, in the xx-direction and in the yy-direction. The number halfway between two numbers is their mean: add them and halve the sum.

xM=xA+xB2,yM=yA+yB2x_M = \frac{x_A + x_B}{2}, \qquad y_M = \frac{y_A + y_B}{2}

On the xx-axis, 44 is halfway between 22 and 66; on the yy-axis, 33 is halfway between 11 and 55.

Example 2

Find the midpoint MM of the segment from A(−2,7)A(-2, 7) to B(6,1)B(6, 1).

  1. 01

    Add the two xx-coordinates and halve the sum.

    xM=−2+62=42=2x_M = \frac{-2 + 6}{2} = \frac{4}{2} = 2
  2. 02

    Add the two yy-coordinates and halve the sum.

    yM=7+12=82=4y_M = \frac{7 + 1}{2} = \frac{8}{2} = 4
  3. 03

    Write the two numbers as a point.

    M(2,4)M(2, 4)
Answer

The midpoint is M(2,4)M(2, 4). Check: from A to M it is 44 to the right and 33 down, and from M to B exactly the same again.

Self-check

The segment from A(3,−4)A(3, -4) to B(9,2)B(9, 2) has the midpoint MM. What is the xx-coordinate of MM?

Show the solution

xM=3+92=122=6x_M = \frac{3 + 9}{2} = \frac{12}{2} = 6. The whole midpoint is M(6,−1)M(6, -1), because yM=−4+22=−1y_M = \frac{-4 + 2}{2} = -1.

For teachers: a lesson plan (45 min)
  1. 5 min

    Starter

    First ask without the simulation: how far apart are (1,2)(1, 2) and (5,2)(5, 2), and why is that easy? What changes when the second point lies higher? Then open the simulation with ‘Full screen’: someone drags B to the height of A and then away again at a slant.

  2. 10 min

    The hidden triangle

    The figure with the two curly brackets: where do the two calculations at the axes come from? How long would the horizontal leg be if A were at x=−2x = -2? Then the first self-check.

  3. 10 min

    Distance

    Reveal Example 1 step by step together. Pupils do the second self-check on their own. Anyone who finishes early swaps A and B in their calculation: what changes, and what stays the same?

  4. 15 min

    Midpoint

    The figure with the green dot M: where would M be if B were two squares lower? Discuss the ‘Watch out’ box. Let pupils try Example 2 on their own first, then reveal it and compare. Then the third self-check.

  5. 5 min

    Plenary

    Read the ‘Remember’ box together. Ask: why do you get the same distance when you swap A and B?

Got an exercise on paper?

Take a photo of it and Math Explainer turns it into an explainer video with every step of the solution.

Upload a photo