Distance, Midpoint and Gradient (AI SL)

Before you can build a Voronoi diagram or the equation of a line, you need the three basic measurements between two coordinates: how far apart they are, where they meet in the middle, and how steeply the segment between them rises. This page collects all three formulas in one place, with worked examples and the slips that most often cost a mark. It's part of the broader Coordinate Geometry & Voronoi topic.

15 questions on this sub-topic.

Practise distance, midpoint and gradient → Try exam-style questions

The three formulas

Covered under IB syllabus reference SL3.5, as the groundwork for equations of perpendicular bisectors. None of the three formulas below are in the formula booklet - they're treated as prior knowledge.

Distance

\(d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\)

Pythagoras' theorem applied to the horizontal and vertical gaps between the two points.

Not in the formula booklet - prior knowledge

Midpoint

\(M=\left(\dfrac{x_1+x_2}{2},\dfrac{y_1+y_2}{2}\right)\)

Average the x-coordinates and average the y-coordinates separately.

Not in the formula booklet - prior knowledge

Gradient

\(m=\dfrac{y_2-y_1}{x_2-x_1}\)

The change in \(y\) divided by the change in \(x\) between any two points on the line.

Not in the formula booklet - prior knowledge

Need the fuller syllabus wording and formula-booklet reference table? See Coordinate Geometry & Voronoi.

Worked examples

1
Medium
GDC
[4 marks]

A straight road runs from \(A(1, 1)\) to \(B(13, 6).\)

(a) Find the length of the road (3 significant figures).

(b) A rest stop is placed at the midpoint. State its coordinates.

Worked solution

(a) \(AB = \sqrt{(13-1)^2 + (6-1)^2} = \sqrt{12^2 + 5^2} = \sqrt{169} = 13\) units. M1 A1
Step 2 - Midpoint.

(b) \(M = \left(\frac{1+13}{2}, \frac{1+6}{2}\right) = (7, 3.5).\) M1 A1
\((5, 12, 13)\) is a Pythagorean triple, so the length is exact.

M1 Distance formula A1 Length M1 Midpoint method A1 Midpoint
2
Easy
GDC
[3 marks]

Find the distance between \(P(2, 3)\) and \(Q(8, 11)\).

Worked solution

\(d = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2}\). M1
\(P(2,3),\ Q(8,11)\):
\(d = \sqrt{(8-2)^2 + (11-3)^2} = \sqrt{36 + 64} = \sqrt{100}\) A1 \(= 10.\) A1 \((6, 8, 10)\) is a scaled \((3,4,5)\) triple, so the root is exact.

A GDC is permitted on this paper, so you may evaluate or verify this result directly on the calculator.

M1 Distance formula A1 Substitution A1 Distance
3
Medium
No calc
[3 marks]

Find the distance between \((-1,2)\) and \((2,6).\)

Worked solution

\(d=\sqrt{(2-(-1))^2+(6-2)^2}.\) M1
\(=\sqrt{9+16}.\) A1
\(=5.\) A1

M1 Distance formula A1 \(\sqrt{25}\) A1 \(d=5\)

Common mistakes

Ready to practise properly?

15 distance, midpoint and gradient questions, marked instantly like the real exam.

Quick answers

What is the formula for the distance between two points?

\(d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\), which is Pythagoras' theorem applied to the horizontal and vertical differences between the two points.

What is the formula for the midpoint of two points?

\(M=\left(\dfrac{x_1+x_2}{2},\dfrac{y_1+y_2}{2}\right)\). Average the x-coordinates and average the y-coordinates separately.

← Back to Applications & Interpretation SL topics