Skip to content

Midpoint and distance formulas: coordinates, gradients and line segments

TutorAura guide · Updated

Two questions come up constantly in coordinate geometry: where is the middle of a line segment, and how long is it? The midpoint is the average of the endpoints' coordinates; the distance comes from Pythagoras. Both formulas are short, and knowing where they come from means you can rebuild them if you forget. This guide covers both, the reverse problem of finding a missing endpoint, and how the gradient fits in.

Key takeaways

  • Midpoint: average the x's and average the y's.
  • Distance: square the difference in x, square the difference in y, add, square root.
  • To find a missing endpoint, double the midpoint and subtract the known end.
  • Gradient = change in y ÷ change in x.

The midpoint formula

For endpoints (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2):

M=(x1+x22,  y1+y22)M = \left(\frac{x_1 + x_2}{2},\; \frac{y_1 + y_2}{2}\right)

The midpoint of (2,5)(2, 5) and (8,1)(8, 1) is (2+82,5+12)=(5,3)\left(\dfrac{2 + 8}{2}, \dfrac{5 + 1}{2}\right) = (5, 3).

With negatives: the midpoint of (−4,7)(-4, 7) and (6,−3)(6, -3) is (1,2)(1, 2). Averages can be decimals: the midpoint of (1,2)(1, 2) and (4,9)(4, 9) is (2.5,5.5)(2.5, 5.5).

The distance formula

d=(x2−x1)2+(y2−y1)2d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2}

This is Pythagoras: the horizontal and vertical differences are the two shorter sides of a right-angled triangle and the segment is the hypotenuse.

Distance from (2,5)(2, 5) to (8,1)(8, 1): 62+(−4)2=36+16=52=213≈7.21\sqrt{6^2 + (-4)^2} = \sqrt{36 + 16} = \sqrt{52} = 2\sqrt{13} \approx 7.21.

The order of subtraction doesn't matter because the differences are squared. Leave the answer as a simplified surd unless asked for a decimal.

Finding a missing endpoint

The midpoint of AB is (3,−1)(3, -1) and A is (−2,4)(-2, 4). Find B.

Since the midpoint is halfway, B is as far beyond M as A is before it: B=2M−A=(6−(−2),−2−4)=(8,−6)B = 2M - A = (6 - (-2), -2 - 4) = (8, -6).

Check: the midpoint of (−2,4)(-2, 4) and (8,−6)(8, -6) is (3,−1)(3, -1). ✓

Gradient of the segment

m=y2−y1x2−x1m = \frac{y_2 - y_1}{x_2 - x_1}

From (2,5)(2, 5) to (8,1)(8, 1): m=1−58−2=−46=−23m = \dfrac{1 - 5}{8 - 2} = -\dfrac{4}{6} = -\dfrac{2}{3}. The line slopes down.

Midpoint, distance and gradient together let you find the perpendicular bisector of a segment: it passes through the midpoint with gradient −1/m-1/m. For the segment above, that's gradient 32\tfrac{3}{2} through (5,3)(5, 3), so y−3=32(x−5)y - 3 = \tfrac{3}{2}(x - 5). See straight line graphs for the equation of a line.

Shapes on a grid

These formulas prove facts about shapes. To show that a quadrilateral is a parallelogram, check that the diagonals have the same midpoint. To show a triangle is isosceles, show two sides have the same length. To show it's right-angled, check that the gradients of two sides multiply to −1, or that the side lengths satisfy Pythagoras.

Example: P(1,1)P(1, 1), Q(4,5)Q(4, 5), R(8,2)R(8, 2). PQ=9+16=5PQ = \sqrt{9 + 16} = 5, QR=16+9=5QR = \sqrt{16 + 9} = 5, so triangle PQR is isosceles. Gradient of PQ is 43\tfrac{4}{3} and of QR is −34-\tfrac{3}{4}; they multiply to −1, so the angle at Q is a right angle too.

Practice questions

  1. Find the midpoint of (−3,8)(-3, 8) and (5,−2)(5, -2).
  2. Find the distance between (0,0)(0, 0) and (9,12)(9, 12).
  3. Find the exact distance between (1,4)(1, 4) and (6,7)(6, 7).
  4. M(2,6)(2, 6) is the midpoint of AB. A is (7,10)(7, 10). Find B.
  5. Find the gradient of the line through (3,−2)(3, -2) and (7,6)(7, 6).

Answers: 1. (1,3)(1, 3). 2. 15. 3. 25+9=34\sqrt{25 + 9} = \sqrt{34}. 4. (−3,2)(-3, 2). 5. 2.

More practice in our midpoint questions, the midpoint calculator and the distance calculator.

Frequently asked questions

How do you find the midpoint of two points?

Add the x-coordinates and halve; add the y-coordinates and halve. The midpoint of (2, 5) and (8, 1) is (5, 3).

Where does the distance formula come from?

From Pythagoras' theorem. The horizontal and vertical differences between the points form a right-angled triangle, and the distance is its hypotenuse.

Does it matter which point is (x₁, y₁)?

Not for the midpoint or the distance. For the gradient, keep the same order on the top and bottom of the fraction.

Sources

  1. GCSE mathematics: subject content and assessment objectives. Department for Education.
  2. Cambridge IGCSE Mathematics 0580 syllabus. Cambridge International.