Coordinate Geometry

Distance and midpoint between two points, and why it is Pythagoras

By Mr Gan · O-Level E Maths · Updated August 2026 · 7 min read

The distance between (x₁, y₁) and (x₂, y₂) is d = √((x₂ − x₁)² + (y₂ − y₁)²): it is just Pythagoras' theorem, with the horizontal and vertical differences as the two shorter sides of a right triangle. The midpoint is simply the average of the coordinates: ((x₁ + x₂)/2, (y₁ + y₂)/2). Once you see the distance formula as a triangle rather than a formula to memorise, it stops being a separate topic to learn.

Why students treat this as two unrelated formulas

Most students meet the distance formula and the midpoint formula as two separate things to memorise, alongside gradient, once they move past the basics of reading points on the Cartesian plane into the same coordinate geometry chapter. Because they look similar (both start from two coordinate points), it is easy to mix up which formula does what, or to forget the square root at the end of the distance formula.

The fix is to stop treating d = √((x₂ − x₁)² + (y₂ − y₁)²) as an arbitrary formula. It is Pythagoras' theorem c² = a² + b², rearranged. If you can draw the right triangle between the two points, you do not need to memorise the distance formula at all: you can rebuild it every time.

The method: draw the triangle

Step 1

Find the horizontal difference: x₂ − x₁

Step 2

Find the vertical difference: y₂ − y₁

Step 3

Square both, add them: this is a² + b²

Step 4

Square root the sum: this is c, the distance

Picture the two points as opposite corners of a rectangle. The horizontal difference (x₂ − x₁) and the vertical difference (y₂ − y₁) are the two straight sides of a right triangle, and the line joining the two points is the hypotenuse. Pythagoras' theorem gives you the length of that hypotenuse directly, and that length is the distance between the points.

The midpoint works differently: there is no triangle involved, only an average. The midpoint's x-coordinate is the average of the two x-coordinates, and its y-coordinate is the average of the two y-coordinates: M = ((x₁ + x₂)/2, (y₁ + y₂)/2). This makes sense visually too: the midpoint sits exactly halfway along the straight line joining the two points, so it must be halfway between their x-values and halfway between their y-values.

Watch the whole method in about a minute.

Worked example 1: distance with negative coordinates

Find the distance between A(−3, −1) and B(3, 5), giving your answer as a surd in its simplest form.

Solution

1
Horizontal difference: x₂ − x₁ = 3 − (−3) = 6.
2
Vertical difference: y₂ − y₁ = 5 − (−1) = 6.
3
Square and add: 6² + 6² = 36 + 36 = 72.
4
Square root: d = √72.
5
Simplify the surd: 72 = 36 × 2, so √72 = √36 × √2 = 6√2.

Quick check: subtracting a negative always turns into an addition, so 3 − (−3) becomes 3 + 3 = 6. This is the same sign rule as everywhere else in algebra: watch it carefully when either point has negative coordinates.

Worked example 2: midpoint, and finding a missing endpoint

Part (a): find the midpoint of P(2, −5) and Q(−6, 3).

Solution (a)

1
Average the x-coordinates: (2 + (−6)) / 2 = −4 / 2 = −2.
2
Average the y-coordinates: (−5 + 3) / 2 = −2 / 2 = −1.
3
Midpoint: (−2, −1).

Part (b): M(4, 1) is the midpoint of A(−2, 5) and B. Find the coordinates of B.

Solution (b)

1
The midpoint formula says 4 = (−2 + x_B) / 2, so multiply both sides by 2: 8 = −2 + x_B, giving x_B = 10.
2
Similarly, 1 = (5 + y_B) / 2, so 2 = 5 + y_B, giving y_B = −3.
3
So B = (10, −3). Check: the midpoint of (−2, 5) and (10, −3) is ((−2 + 10)/2, (5 − 3)/2) = (4, 1), which matches M.

The step students get wrong

Two mistakes cause almost every lost mark on this topic. First, subtracting the coordinates in the midpoint formula instead of adding them: the midpoint always adds the two x-values and the two y-values before dividing by 2, it never subtracts. Second, sign slips when squaring a negative difference: (−6)² = 36, not −36, because a negative number squared is always positive. Write out the subtraction in full before squaring, especially when a coordinate is negative, so the sign is not lost in your head.


Frequently asked questions

Do I need to memorise the distance formula separately from Pythagoras' theorem?

Not really. If you can sketch the two points and draw the right triangle between them, the horizontal and vertical differences are the two shorter sides, and Pythagoras' theorem gives you the hypotenuse. The distance formula is that same calculation written out algebraically so you can do it without a sketch, useful for the equation of a straight line and for questions involving 3D trigonometry where a full diagram takes too long to draw.

Does it matter which point I call (x₁, y₁) and which I call (x₂, y₂)?

No, for distance. Swapping the two points flips the sign of both differences, but each difference gets squared, so the final answer under the square root is unchanged. For the midpoint it also does not matter, since addition does not care about order. Only for gradient, used when finding the equation of a straight line, does the order matter, because that involves division.

How do I know whether to leave my distance answer as a surd or round it as a decimal?

Follow the instruction in the question. "Leave your answer in surd form" or "in the form a√b" means simplify the surd fully, as in worked example 1. If the question says "give your answer correct to 2 decimal places" or similar, evaluate the square root as a decimal instead. When no instruction is given, an exact surd is usually the safer choice.

Is the midpoint formula related to vectors?

Yes. A column vector between two points is built from the same horizontal and vertical differences used in the distance formula, and its magnitude is calculated the same way, by squaring, adding, and taking the square root. If this topic makes sense to you, column vectors and magnitude will follow the same logic.

— Mr Gan Math Tuition

Still memorising formulas instead of seeing the triangle?

Mr. Gan connects coordinate geometry back to the geometry students already know, so nothing has to be memorised in isolation.

Chat with Mr. Gan