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
To find the length of a line segment from the coordinates of its ends. It is Pythagoras on the horizontal and vertical gaps.
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
Squaring a negative wrongly: (−6)² = 36, not −36. Put negative differences in brackets.
On your course
| Course | In the exam |
|---|---|
| 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 |
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
Questions
What is the distance formula?
The distance formula is d = √((x₁ − x₂)² + (y₁ − y₂)² + (z₁ − z₂)²). d: the distance between the two points; (x₁, y₁, z₁), (x₂, y₂, z₂): the two points (leave out z in 2D).
Is the distance formula given in the exam?
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. This comes from our own IB Maths formula sheets; your teacher has the official booklet.
How is the distance formula related to Pythagoras?
The horizontal and vertical gaps between the points are the two shorter sides of a right-angled triangle, so the distance is its hypotenuse.
Our own wording, examples and card, checked by IB Math Revision. Not produced or endorsed by the International Baccalaureate Organization.