Straight across the grid
How far is it from (1, 1) to (4, 5) in a straight line? Counting steps along the grid lines, 3 across and then 4 up, gives 3 + 4 = 7. But that is the length of a path with a corner in it. The straight line between the points is shorter.
A right triangle under the line
Go from (1, 1) across to (4, 1), then up to (4, 5). The first move is horizontal and the second is vertical, so they meet at a right angle at (4, 1). Together with the straight line from (1, 1) to (4, 5), they make a right triangle.
The two shorter sides are the run, 4 − 1 = 3, and the rise, 5 − 1 = 4. The straight line between the two points is the side opposite the right angle: the hypotenuse.
The run from (1, 1) to (4, 1) is 3 and the rise from (4, 1) to (4, 5) is 4. They meet at a right angle, and the line from (1, 1) to (4, 5) is the hypotenuse.
Pythagoras on the grid
In a right triangle, the square of the hypotenuse is the sum of the squares of the two shorter sides. So the distance d satisfies , and .
The straight line is 5 long, and the path along the grid lines is 7. The hypotenuse is always shorter than the two other sides added together.
AB is the diagonal of a 5 by 3 box, √(5² + 3²) = 5.83; M = (1, −1) is the average of the x-coordinates and the average of the y-coordinates, found separately
Make the box 3 by 4 and read the distance
A and B sit at opposite corners of the dashed box, whose sides are the run and the rise. The distance AB is the diagonal of the box, the hypotenuse of a right triangle with those two sides, and the working at the top left finds it by Pythagoras’ theorem. When the box is 3 by 4, .
The distance formula
For any two points and , the run is and the rise is . Square them, add, and take the square root: .
From (−2, 3) to (4, −5), the run is 4 − (−2) = 6 and the rise is −5 − 3 = −8. Then .
The rise came out negative, because the second point is lower. That does not matter: the whole difference is squared, and , the same as . So it makes no difference which point is taken first.
From (−2, 3) to (4, −5): 6 across and 8 down. The triangle has shorter sides 6 and 8, so the distance is .
When the root is not a whole number
From (1, 2) to (4, 4), the run is 3 and the rise is 2, so . No whole number squares to 13, so the exact distance is , which is about 3.61. Leave it as unless a decimal is asked for.
A root can sometimes be simplified. From (0, 0) to (2, 4), , and .
To compare two distances, compare their squares. Is Q(4, 6) or R(7, 2) nearer to P(1, 1)? PQ² , and PR² . The smaller square belongs to the shorter distance, so Q is nearer, and no square root had to be worked out.
Points level with each other
When two points have the same y-coordinate, there is no rise, and the distance is the difference in x. From (2, 3) to (9, 3) it is 9 − 2 = 7. The formula agrees: . Points with the same x-coordinate work the same way, with the difference in y.
The usual mistakes
Adding the run and the rise. For (1, 1) and (4, 5), 3 + 4 = 7 is the path along the grid lines. The straight-line distance is .
Stopping at the square. is , not d. The last step is the square root: .
Squaring a negative difference without its bracket. read as −64 gives , which has no answer. The difference is −8, and .
Worked example: A Delivery Drone's Straight Flight and the Nearer of Two Charging Depots
Question A map has a grid in kilometers. A drone flies in a straight line from its base at L(2, 2) to a customer at S(14, 7). It then flies straight to a depot to recharge. Depot P is at (8, 15) and depot Q is at (21, 15). (a) How far does the drone fly from L to S? (b) Which depot is nearer to S? The battery lasts for 25 km of flight. Is that enough for the flight from the base to the customer and on to the nearer depot?
1.From L(2, 2) to S(14, 7) the difference in x is 14 − 2 = 12 and the difference in y is 7 − 2 = 5. These are the two shorter sides of a right-angled triangle whose hypotenuse is the flight.
From L to S the map goes 14 − 2 = 12 across and 7 − 2 = 5 up. The flight is the hypotenuse of this right-angled triangle. 2.(a) By Pythagoras' theorem, LS = √122 + 52 = √144 + 25 = √169 = 13. The drone flies 13 km to the customer.
(a) LS = √122 + 52 = √169 = 13, so the drone flies 13 km to the customer. 3.From S(14, 7) to P(8, 15) the differences are 8 − 14 = −6 and 15 − 7 = 8, so SP2 = (−6)2 + 82 = 36 + 64 = 100 and SP = 10 km.
From S to P the differences are −6 and 8, so SP2 = 36 + 64 = 100 and SP = 10 km. 4.From S(14, 7) to Q(21, 15) the differences are 21 − 14 = 7 and 15 − 7 = 8, so SQ2 = 72 + 82 = 49 + 64 = 113. Since 113 is more than 100, SQ is longer than SP.
From S to Q the differences are 7 and 8, so SQ2 = 49 + 64 = 113. This is more than 100, so SQ is longer than SP. 5.(b) Depot P is nearer, at 10 km from S. The whole flight is 13 + 10 = 23 km, which is less than 25 km, so the battery lasts with 2 km to spare.
(b) Depot P is nearer, at 10 km. The whole flight is 13 + 10 = 23 km, which is less than 25 km, so the battery lasts.
Answer: (a) 13 km; (b) depot P, which is 10 km from S, because SQ2 = 113 is more than SP2 = 100; the whole flight is 23 km, so 25 km is enough
Common mistakes
- Adding the two differences, 12 + 5 = 17 km, for the flight. That is the distance along the grid lines. The drone flies straight, along the hypotenuse, which is √122 + 52 = 13 km.
- Writing −62 = −36 for the flight to P, which gives SP2 = 28. The difference −6 is squared as a whole, (−6)2 = 36. A square is never negative, so the order of the subtraction does not change the distance.
More quadratic graphs and coordinate geometry problems, worked step by step →