sciandu
Mathematics

Mathematics

Distance between two points

Two pairs of numbers are enough: a hidden triangle gives you the straight-line distance and the midpoint as well.

Two friends live in the same city: one at the corner (1,2)(1, 2), the other at (5,5)(5, 5). How far apart are the two flats as the crow flies? On a city map you could measure the line with a ruler, but there is a more precise way: the two pairs of numbers alone are enough to work out the distance exactly. All you need are two differences and Pythagoras' theorem.

The hidden triangle

Join the two points with a straight segment. Then draw a horizontal line to the right starting at A(1,2)A(1, 2) and a vertical line downwards starting at B(5,5)B(5, 5). The two meet at (5,2)(5, 2), and together with your segment they form a right triangle. The two sides at the right angle are called the legs, the side opposite it is the , and that hypotenuse is exactly your segment. The horizontal leg is as long as the difference of the x-values: 51=45 - 1 = 4. The vertical leg is the difference of the y-values: 52=35 - 2 = 3. That reduces the task to something you already know: 42+32=254^2 + 3^2 = 25, so the segment is 25=5\sqrt{25} = 5 squares long.

d=(x2x1)2+(y2y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}
This is the distance formula in general. Here dd is the distance between the points A(x1,y1)A(x_1, y_1) and B(x2,y2)B(x_2, y_2), and under the root sit the two legs, each squared on its own. For A(1,2)A(1, 2) and B(5,5)B(5, 5) that gives 42+32=25=5\sqrt{4^2 + 3^2} = \sqrt{25} = 5 squares. If one square on the map stands for 100 m, that is 500 m as the crow flies.
Coordinate grid
x3
y2
-6-6-4-4-2-2224466
P (3 | 2)
Try it: set the point to (3,4)(3, 4) and work out its distance from the origin (0,0)(0, 0) in your head. Then move it to (6,8)(6, 8) and check whether the distance has really doubled.

Signs do not matter

What if the second point lies to the left of or below the first one? Then one difference turns negative, but that does no harm: a leg length is never negative, only the size of the difference counts, and squaring removes the minus sign anyway. For P(2,1)P(-2, 1) and Q(3,3)Q(3, -3) we get 3(2)=53 - (-2) = 5 and 31=4-3 - 1 = -4, so the legs are 5 and 4 squares long. Squared that gives 25+16=4125 + 16 = 41, so the distance is 41\sqrt{41}, roughly 6.4 squares. As you can see, not every distance is a tidy number, often a root remains and you round it.

The midpoint of a segment

Often you want to know not just how far apart two points are, but also where exactly the middle between them lies: a fair meeting spot for two friends, the centre of a bridge, the middle of a playing field. That is even easier than the distance, because no root is needed here. You take the average of each coordinate separately, that is the sum of the two values divided by 2. For A(1,2)A(1, 2) and B(5,5)B(5, 5) the x-coordinate of the middle is (1+5)÷2=3(1 + 5) \div 2 = 3 and the y-coordinate is (2+5)÷2=3.5(2 + 5) \div 2 = 3.5. So the midpoint is M(3,3.5)M(3, 3.5).

M(x1+x22,  y1+y22)M\left( \frac{x_1 + x_2}{2},\; \frac{y_1 + y_2}{2} \right)
Every coordinate of the midpoint is the average of the two matching values. The middle between 22 and 55 is 3.5, and it works the same way with negative numbers: between 4-4 and 22 lies (4+2)÷2=1(-4 + 2) \div 2 = -1.

Exercises

0 of 6 solved

Time to try it yourself. You can't break anything, every attempt counts.

You want to work out the distance between two points. What are the two legs of the helper triangle?

How far is the point P(3,4)P(3, 4) from the origin (0,0)(0, 0)? Give the distance in squares.

How far apart are the points A(1,3)A(1, 3) and B(13,8)B(13, 8)? Give the distance in squares.

Each coordinate of the midpoint of a segment is the of the two matching end coordinates.

Which expression gives the distance between the points A(x1,y1)A(x_1, y_1) and B(x2,y2)B(x_2, y_2)?

Put the steps in the correct order to calculate the distance between two points.

  1. 1Form the difference of the x-values and of the y-values
  2. 2Take the square root of the sum
  3. 3Add the two squares
  4. 4Square both differences