Distance, midpoint and gradient
What this lesson covers
- Gradient is the rise divided by the run.
- Distance comes from Pythagoras on the rise and run.
- The midpoint averages the x values and averages the y values.
See the triangle
- Every formula here comes from this picture.
One triangle, three formulas
- Take any two points and draw the right-angled triangle between them. The run is the difference in x and the rise is the difference in y.
- Gradient m = (y₂ − y₁) ÷ (x₂ − x₁).
- Distance d = √((x₂ − x₁)² + (y₂ − y₁)²).
- Midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2).
From A(1, 2) to B(7, 10)
- Find the run and rise first: both are used twice.
- run = 7 − 1 = 6, rise = 10 − 2 = 8
- m = 8 ÷ 6 = 4/3rise over run
- d = √(36 + 64) = √100 = 10Pythagoras
- midpoint = (4, 6)average each coordinate
Try it: drag the points
- Drag either point. Gradient, distance and midpoint update as you go.
Using the midpoint backwards
- M(3, 4) is the midpoint of A(1, 1) and B. Find B.
- (1 + x) ÷ 2 = 3, so x = 5
- (1 + y) ÷ 2 = 4, so y = 7
- B is (5, 7)
Try it: the midpoint and the bisector
Common mistakes
- Subtracting in a different order on the top and the bottom.Use the same point first in both, or the sign of the gradient flips.
- Subtracting the coordinates to find a midpoint.A midpoint adds and halves, because it is an average.
Try it: one triangle, four questions
Your turn
Find the gradient from (1, 2) to (3, 8).
Find the distance from (0, 0) to (5, 12).
Find the midpoint of (2, 6) and (8, 0).
M(2, 2) is the midpoint of A(0, 1) and B. Find B.
Find the exact distance between (−1, 4) and (3, −2).
The line through (2, 1) and (6, k) has gradient 3/2. Find k.
A path runs from gate A(−3, 2) to gate B(5, 8), in units of 100 m. A bench sits at its midpoint. Where is it, and how far from A?
P(2, 3), Q(8, 3) and R(5, 7) form a triangle. Which is true?
Show answer
1. 6 ÷ 2 = 3 2. √(25 + 144) = 13 3. (5, 3) 4. (4, 3) 5. √52 (which is 2√13). Run 3 − (−1) = 4, rise −2 − 4 = −6, so d = √(16 + 36) = √52. 6. k = 7. Rise over run: (k − 1) ÷ 4 = 3/2, so k − 1 = 6 and k = 7. 7. (1, 5), 500 m from A. Midpoint ((−3 + 5) ÷ 2, (2 + 8) ÷ 2) = (1, 5); AB = √(64 + 36) = 10 units, so half is 5 units = 500 m. 8. PR = QR = 5, so it is isosceles. PR = √(9 + 16) = 5 and QR = √(9 + 16) = 5, while PQ = 6.
Sample question: Achieved
Find the distance between A(−2, 5) and B(4, −3), and the midpoint of AB.
Hint
Find the run and the rise first, then use Pythagoras for the distance and average the coordinates for the midpoint.
Answer
AB = 10 and the midpoint is (1, 1)
Step by step
- Start with the run and the rise, because both formulas use them.
- Run = 4 − (−2) = 6. Rise = −3 − 5 = −8. Take B minus A in both, so the signs stay consistent.
- Distance is Pythagoras on the run and rise: √(6² + (−8)²) = √(36 + 64) = √100 = 10.
- The midpoint averages the x values and averages the y values.
- x: (−2 + 4) ÷ 2 = 1. y: (5 + (−3)) ÷ 2 = 1. So the midpoint is (1, 1).
- Classic mistake: subtracting the coordinates for the midpoint. A midpoint always adds, then halves.
- Check: from A(−2, 5) to (1, 1) is a run of 3 and a rise of −4, exactly half of 6 and −8.
Full working
- run = 6, rise = −8B minus A
- AB = √(36 + 64) = √100 = 10Pythagoras
- M = ((−2 + 4) ÷ 2, (5 − 3) ÷ 2)average each coordinate
- AB = 10, M = (1, 1)
Sample questions: Merit
P(a, 3) is exactly 5 units from Q(1, −1). Find both possible values of a, and the gradient of PQ for each.
Hint
Write the distance formula with a in it, set it equal to 5, and square both sides.
Answer
a = 4, with gradient 43; or a = −2, with gradient −43
Step by step
- The distance formula links the two points: PQ² = (a − 1)² + (3 − (−1))².
- PQ = 5, so square both sides to remove the square root: (a − 1)² + 16 = 25.
- Take 16 from both sides: (a − 1)² = 9.
- A square of 9 comes from 3 or −3. Do not forget the negative one: a − 1 = 3 or a − 1 = −3.
- So a = 4 or a = −2. There really are two points, one on each side of Q.
- Gradient for a = 4: rise ÷ run = (3 − (−1)) ÷ (4 − 1) = 43.
- Gradient for a = −2: (3 − (−1)) ÷ (−2 − 1) = 4 ÷ (−3) = −43.
- Check a = −2: run −3 and rise 4 give √(9 + 16) = √25 = 5. Correct.
Full working
- (a − 1)² + 4² = 5²distance formula, squared
- (a − 1)² = 9
- a − 1 = ±3, so a = 4 or a = −2two square roots
- a = 4: m = 43rise 4, run 3
- a = −2: m = 4−3 = −43rise 4, run −3
- a = 4, m = 43 or a = −2, m = −43
A(1, 1), B(5, 3) and C(3, 7) are the corners of a triangle. Show that the triangle is isosceles and right-angled, and find its area.
Hint
Find all three side lengths. Two equal sides make it isosceles; Pythagoras on the three lengths tests for a right angle.
Answer
AB = BC = √20 and AB² + BC² = AC², so it is isosceles with a right angle at B; area = 10 square units
Step by step
- To show facts about the sides, find all three lengths with the distance formula.
- AB: run 4, rise 2, so AB = √(16 + 4) = √20.
- BC: run −2, rise 4, so BC = √(4 + 16) = √20.
- AC: run 2, rise 6, so AC = √(4 + 36) = √40.
- AB = BC, so the triangle is isosceles.
- For a right angle, Pythagoras must work: AB² + BC² = 20 + 20 = 40 = AC². So the angle opposite AC, at B, is 90°.
- In a right-angled triangle the two shorter sides are a base and a height: area = ½ × √20 × √20 = ½ × 20 = 10.
- Classic mistake: rounding √20 to 4.47 too early. Keep the surds and the area comes out exact.
- Check with gradients: AB has gradient 24 = 12 and BC has gradient 4−2 = −2. Their product is −1, so they are perpendicular.
Full working
- AB = √(4² + 2²) = √20
- BC = √((−2)² + 4²) = √20
- AC = √(2² + 6²) = √40
- AB = BCisosceles
- AB² + BC² = 20 + 20 = 40 = AC²Pythagoras holds, right angle at B
- area = ½ × √20 × √20the two shorter sides are base and height
- isosceles, right-angled at B, area 10 square units
Sample questions: Excellence
A(−1, 2), B(3, 4) and C(5, 0) are three corners of a parallelogram ABCD. Find D, then prove that ABCD is in fact a square.
Hint
The diagonals of a parallelogram share a midpoint. For the square, show two neighbouring sides are equal and at right angles.
Answer
D = (1, −2); AB = BC = √20 and the gradients of AB and BC multiply to −1, so ABCD is a square
Step by step
- In a parallelogram the diagonals cut each other in half, so AC and BD have the same midpoint.
- Midpoint of AC: ((−1 + 5) ÷ 2, (2 + 0) ÷ 2) = (2, 1).
- D must make the midpoint of BD also (2, 1): (3 + x) ÷ 2 = 2 gives x = 1, and (4 + y) ÷ 2 = 1 gives y = −2. So D = (1, −2).
- A parallelogram is a square when two neighbouring sides are equal and meet at 90°. Test AB and BC.
- AB = √(4² + 2²) = √20 and BC = √(2² + (−4)²) = √20. They are equal, so ABCD is at least a rhombus.
- Gradient AB = 24 = 12. Gradient BC = −42 = −2.
- (12) × (−2) = −1, so AB is perpendicular to BC.
- A parallelogram with equal neighbouring sides at right angles is a square. That is the proof.
- Classic mistake: showing only that all four sides are equal. That proves a rhombus, not a square; you also need the right angle.
- Check D: going from A to D should be the same move as from B to C. A to D is (+2, −4), B to C is (+2, −4). It matches.
Full working
- M of AC = (2, 1)diagonals bisect each other
- (3 + x) ÷ 2 = 2, (4 + y) ÷ 2 = 1, so D = (1, −2)M of BD is also (2, 1)
- AB = √(16 + 4) = √20, BC = √(4 + 16) = √20neighbouring sides equal
- m(AB) = 12, m(BC) = −2rise over run
- (12) × (−2) = −1AB ⊥ BC
- D = (1, −2); ABCD is a square
O(0, 0), A(2a, 0) and B(0, 2b) form a right-angled triangle, with a and b positive. Prove that the midpoint of the hypotenuse AB is the same distance from all three corners.
Hint
Find the midpoint M of AB in terms of a and b, then find MO, MA and MB with the distance formula.
Answer
M = (a, b) and MO = MA = MB = √(a² + b²), so M is equally far from all three corners
Step by step
- The right angle is at O, because OA lies on the x-axis and OB on the y-axis. So the hypotenuse is AB.
- Using 2a and 2b keeps the midpoint free of fractions. Midpoint of AB: ((2a + 0) ÷ 2, (0 + 2b) ÷ 2) = (a, b).
- MO: run a, rise b, so MO = √(a² + b²).
- MA: from (a, b) to (2a, 0) is run a, rise −b, so MA = √(a² + b²).
- MB: from (a, b) to (0, 2b) is run −a, rise b, so MB = √(a² + b²).
- All three are √(a² + b²). Because a and b can be any positive numbers, this is true for every right-angled triangle.
- So the midpoint of the hypotenuse is the centre of a circle through all three corners.
- Classic mistake: proving it for one triangle with numbers. That is an example, not a proof. Letters cover every case.
- Check with a = 3, b = 4: M = (3, 4) and MO = 5, MA = √(9 + 16) = 5, MB = √(9 + 16) = 5.
Full working
- M = ((2a + 0) ÷ 2, (0 + 2b) ÷ 2) = (a, b)midpoint of the hypotenuse
- MO = √(a² + b²)
- MA = √((2a − a)² + (0 − b)²) = √(a² + b²)
- MB = √((0 − a)² + (2b − b)²) = √(a² + b²)
- MO = MA = MB = √(a² + b²), true for all a, b > 0
What to take away
- Draw the triangle: run and rise give you everything.
- Gradient divides, distance uses Pythagoras, midpoint averages.
Challenge
Point A lies on the line y = x and point B lies on the line y = −2x. The midpoint of AB is M(3, 0). Find A and B, then the exact length and the gradient of AB.
Hint
Call the points A(s, s) and B(t, −2t). The midpoint gives two equations in s and t.
Answer
A = (4, 4), B = (2, −4); AB = √68 = 2√17 ≈ 8.25 units; gradient 4
Step by step
- A point on y = x has equal coordinates, so write A(s, s). A point on y = −2x can be written B(t, −2t).
- Midpoint x: (s + t) ÷ 2 = 3, so s + t = 6.
- Midpoint y: (s − 2t) ÷ 2 = 0, so s = 2t.
- Substitute: 2t + t = 6, so t = 2 and s = 4. A = (4, 4) and B = (2, −4).
- Run from A to B is −2 and rise is −8, so AB = √(4 + 64) = √68 = 2√17 and the gradient is −8 ÷ −2 = 4.
- Check: ((4 + 2) ÷ 2, (4 − 4) ÷ 2) = (3, 0). Correct.
Full working
- A(s, s), B(t, −2t)each point on its own line
- s + t = 6 and s − 2t = 0midpoint (3, 0)
- 3t = 6, so t = 2, s = 4
- run = −2, rise = −8A to B
- AB = √((−2)² + (−8)²) = √68 = 2√17, m = 4
- A(4, 4), B(2, −4), AB = 2√17 ≈ 8.25, gradient 4
A(−2, 1) and C(6, 5) are opposite corners of a rhombus ABCD with every side 5 units long. Find B and D, and the area of the rhombus.
Hint
B is 5 units from A and 5 units from C. Write both distance equations, square them, and subtract one from the other to get a straight line.
Answer
B and D are (3, 1) and (1, 5) (either way round); area 20 square units
Step by step
- Let a corner be (x, y). It is 5 from A and 5 from C: (x + 2)² + (y − 1)² = 25 and (x − 6)² + (y − 5)² = 25.
- Expand and subtract: the x² and y² cancel, leaving 16x + 8y − 56 = 0, so y = 7 − 2x.
- Substitute into the first: (x + 2)² + (6 − 2x)² = 25, which tidies to x² − 4x + 3 = 0, so x = 1 or x = 3.
- x = 1 gives (1, 5) and x = 3 gives (3, 1). These are the other two corners, B and D.
- The diagonals are AC = √(64 + 16) = √80 and BD = √(4 + 16) = √20. They cross at right angles at their shared midpoint (2, 3), cutting the rhombus into 4 equal right-angled triangles.
- Area = ½ × √80 × √20 = ½ × √1600 = ½ × 40 = 20.
Full working
- (x + 2)² + (y − 1)² = 255 from A
- (x − 6)² + (y − 5)² = 255 from C
- 16x + 8y − 56 = 0, so y = 7 − 2xsubtract
- 5x² − 20x + 15 = 0, so x = 1 or 3substitute
- B, D = (3, 1), (1, 5)
- area = ½ × √80 × √20 = 20half the product of the diagonals
- B(3, 1), D(1, 5), area 20 square units
ABCD is any quadrilateral, with A(2p, 2q), B(2r, 2s), C(2t, 2u) and D(2v, 2w). P, Q, R and S are the midpoints of AB, BC, CD and DA. Prove that PQRS is always a parallelogram, and that its perimeter equals AC + BD.
Hint
Find the four midpoints in letters. Compare the run and rise from P to Q with those from S to R, and compare PQ with the diagonal AC.
Answer
PQ and SR both have run t − p and rise u − q, and QR and PS both have run v − r and rise w − s, so opposite sides are equal and parallel; PQ = SR = ½AC and QR = PS = ½BD, so the perimeter is AC + BD
Step by step
- The 2s keep the midpoints free of fractions: P = (p + r, q + s), Q = (r + t, s + u), R = (t + v, u + w), S = (v + p, w + q).
- P to Q: run t − p, rise u − q. S to R: run t − p, rise u − q. The same move, so PQ and SR are parallel and equal in length.
- Q to R: run v − r, rise w − s. P to S: run v − r, rise w − s. So QR and PS are parallel and equal too. Both pairs of opposite sides are parallel: PQRS is a parallelogram.
- PQ = √((t − p)² + (u − q)²). AC has run 2t − 2p and rise 2u − 2q, so AC = 2√((t − p)² + (u − q)²). So PQ = SR = ½AC.
- In the same way QR = PS = ½BD.
- Perimeter = 2 × ½AC + 2 × ½BD = AC + BD. Letters cover every quadrilateral, so this is a proof, not an example.
Full working
- P(p + r, q + s), Q(r + t, s + u), R(t + v, u + w), S(v + p, w + q)midpoints
- P to Q and S to R: run t − p, rise u − qequal and parallel
- Q to R and P to S: run v − r, rise w − sequal and parallel
- PQ = √((t − p)² + (u − q)²) = ½ × √((2t − 2p)² + (2u − 2q)²) = ½AC
- QR = √((v − r)² + (w − s)²) = ½BD
- perimeter = 2(½AC) + 2(½BD)
- PQRS is a parallelogram with perimeter AC + BD