Distance formula
The straight-line distance between two points and : Pythagoras on a grid.
Calculator
The live calculator needs JavaScript. The worked example below shows the same steps it would.
See it move
- Distance AB = √(36 + 64) ≈ 10
- Midpoint M = (2, −2)
- Slope = Δy/Δx = −1.3333
What the symbols mean
- the distance between the two points (never negative)
- the x-coordinate of the first point
- the y-coordinate of the first point
- the x-coordinate of the second point
- the y-coordinate of the second point
When to use it
Use it whenever you need the length of a segment from its endpoints' coordinates: the side of a shape drawn on a grid, the radius of a circle from its centre and a point on it, or checking whether a triangle is isosceles or right-angled. Solved the other way, it finds the points at a given distance, which usually gives two answers (one each side).
Worked example
Find the distance between A(−1, 2) and B(5, −6).
Start from the formula.
Substitute = , = , = , = and work it out.
The horizontal gap is 6 and the vertical gap is 8; the distance is the hypotenuse of the right triangle they make.
Answer d = 10
Why it works
Draw the horizontal and vertical legs between the two points: they have lengths and and meet at a right angle, so the segment is the hypotenuse. Squaring removes the absolute values, which is why the order of the points does not matter.
Common mistakes
- Mixing coordinates: subtract x from x and y from y, never an x from a y.
- Squaring a negative difference wrongly: , and is also 64, not −64.
- Forgetting the square root at the end and reporting .
- Adding the differences before squaring: is 14, not the distance.