The distance formula
- and are the two points. It doesn't matter which one you call the first.
- is the horizontal change (sometimes called the run).
- is the vertical change (the rise).
- is the straight-line distance between the points, in the same units as the axes.
Some textbooks write it as , where (delta) means "change in". It's the same formula.
Why it works: it’s Pythagoras
Draw a horizontal line from one point and a vertical line from the other. They meet at a right angle, so the line joining the points is the hypotenuse of a right-angled triangle.
The two shorter sides are the change in and the change in . Pythagoras' theorem, , gives
and taking the square root of both sides gives the distance formula. If you forget the formula in a test, sketch the triangle and use Pythagoras. You'll get the same answer.
How to find the distance, step by step
Worked example
Find the distance between and .
1. Find the change in :
2. Find the change in :
3. Square both and add:
4. Take the square root:
Working out the two changes before you square anything keeps the signs under control, and it's exactly what the calculator below does.
Distance between two points calculator
Enter the two points. You’ll get the distance as an exact surd and to 2 decimal places, every step of the working, and a sketch of the right-angled triangle between the points.
Distance with negative coordinates
Worked example
Find the distance between and .
Put the negatives in brackets when you substitute:
Square and add. A negative number squared is positive:
The points are in different quadrants, but nothing changes in the method. A change of just means is units below . Distance is always positive, which is why squaring (and then square rooting) takes care of the direction for you.
Exact answers: leaving the distance as a surd
Most pairs of points don't give a whole-number distance. If the question asks for an exact answer, leave it as a simplified square root (a surd).
Worked example
Find the exact distance between and .
Simplify the surd by pulling out the largest square factor, :
Worked example: on a map
On a map grid measured in kilometres, a campsite is at and a lookout is at . How far apart are they in a straight line, to the nearest km?
The walking track will be longer than this. The distance formula gives the shortest, straight-line distance ("as the crow flies").
Finding a missing coordinate
Sometimes you're given the distance and have to find a coordinate. Substitute everything you know, square both sides to get rid of the square root, then solve.
Worked example
The distance between and is units. Find the possible values of .
Square both sides:
There are two answers because the point could be units to the right of or units to the left. Check one: from to is .
Using distance on shapes
Test questions often give the corners of a shape and ask you to prove something about it. Find the length of each side with the distance formula, then compare.
- Isosceles triangle: two sides are equal.
- Right-angled triangle: the squares of the two shorter sides add to the square of the longest side.
- Rhombus or square: all four sides are equal.
- Perimeter: add up all the side lengths.
Horizontal and vertical sides need no formula. From to the -values match, so the distance is just .
In three dimensions (Year 10A), add a third term: . From to that's . There's more on this in 3D Pythagoras.
Common mistakes
- Subtracting a negative wrongly. is , not . Write negative coordinates in brackets and change to before you go on.
- Typing into a calculator. That gives . Use brackets, , or square the number without its sign, since the square is always positive.
- Adding the coordinates instead of subtracting. The formula uses the differences and . Adding them is the midpoint method, and it gives a different answer.
- Mixing up the order. Use the same point first in both brackets: and . Matching an from one point with a from the other gives nonsense.
- Square rooting each part separately. is , not . Add first, then take the square root.
- Forgetting the second answer when finding a missing coordinate. gives or .
Practice questions with answers
Try each one before you open the answer. Rounded answers are to 2 decimal places.
Find the distance between and .
Show the answer
Changes: and .
Find the distance between and .
Show the answer
Changes: and .
Find the distance between and .
Show the answer
Changes: and .
Find the exact distance between and .
Show the answer
Changes: and .
Find the distance between and .
Show the answer
The -values are the same, so the line is vertical.
Find the distance between and .
Show the answer
Changes: and .
Which point is closer to the origin: or ?
Show the answer
and . So is closer, but only just.
The distance from to is units. Find the two possible values of .
Show the answer
, so and or . So or .
Triangle has vertices , and . Show that it is isosceles and right-angled.
Show the answer
, and . , so it's isosceles. , so by the converse of Pythagoras it has a right angle at .
The Tuterly Method
Snap. Fix. Ace.
Got a distance question wrong? Don't just move on. Study your mistakes.
Snap.
Snap every question you get wrong, from tests, homework and class work.
Fix.
See the worked solution, then fresh questions on that skill. Even just one each day.
Ace.
A full practice test, with questions you've got wrong mixed in.
Distance and coordinate geometry by year level
Following the Victorian Curriculum 2.0. Schools sequence topics differently, so check your course.
Year 8
Pythagoras' theorem
Pythagoras’ theorem: finding the hypotenuse and a shorter side, which the distance formula is built on.
Year 9
Coordinate geometry
The distance between two points, alongside gradient and midpoint.
Year 9
Pythagoras (applied)
Two-step Pythagoras problems, including the distance between points.
Year 10
Coordinate geometry
Parallel and perpendicular lines, with distance and midpoint used in multi-part questions.