Distance formula: d = √((x₁ − x₂)² + (y₁ − y₂)²)
The distance formula is d = √((x₁ − x₂)² + (y₁ − y₂)² + (z₁ − z₂)²).
What each letter means
- \(d\) the distance between the two points
- \((x_1,\ y_1,\ z_1),\ (x_2,\ y_2,\ z_2)\) the two points (leave out z in 2D)
When to use it
In IB Maths for the length of a line segment in 2D or 3D. AI uses it for lengths inside cuboids and pyramids before a trig step; AA uses it with vectors and coordinates.
Worked example
Find the distance between \(A(1,-2,4)\) and \(B(4,2,-8)\).
- \(d=\sqrt{(1-4)^2+(-2-2)^2+(4-(-8))^2}=\sqrt{9+16+144}\)
Answer: \(d=\sqrt{169}=13\)
Common mistake
Dropping the z term in a 3D question. The booklet version has three brackets: use all three.
Fix it with practice: Skill Builder: Coordinate Geometry (free account).
Try one yourself
One quick IB Maths question on the distance formula. No sign-in needed.
Get 5 more like this — freeGoogle, Microsoft or email. No card needed.
On your IB Maths course
| Course | In the exam |
|---|---|
| AA SL All IB AA SL formulas by topic | In the IB formula booklet |
| AI SL All IB AI SL formulas by topic | In the IB formula booklet |
| AA HL All IB AA HL formulas by topic | In the IB formula booklet |
| AI HL All IB AI HL formulas by topic | In the IB formula booklet |
From our own IB Maths formula sheets, in our words. The IB gives its booklet to schools, so we checked against our own copy: your teacher has the official one. Official: IB DP Mathematics page.
Practise and revise
- Practise AI SL 3D coordinate geometry questions
- Practise AI SL coordinate geometry questions
- Revise 3D geometry (AI SL)
- Print AA SL one-page formula sheet
IB Maths FAQ
Is the distance formula in the IB formula booklet?
AA SL: in the IB formula booklet. AI SL: in the IB formula booklet. AA HL: in the IB formula booklet. AI HL: in the IB formula booklet.
Is the IB distance formula the same in 3D?
Yes, with a third term: d = √((x₁ − x₂)² + (y₁ − y₂)² + (z₁ − z₂)²). Leave out z for points in a plane.
Our own wording, examples and card, checked by IB Math Revision. Not produced or endorsed by the International Baccalaureate Organization.