The distance formula gives the straight-line distance between two points on a coordinate plane or in 3D space. For points and in 2D,
For points and in 3D,
Use this formula when you want the actual length between two points, not just the horizontal or vertical change. It applies in standard Cartesian coordinates when each axis uses the same unit scale.
Distance Formula in 2D: What It Measures
The formula combines two perpendicular changes: how far you move in and how far you move in . Those changes form the legs of a right triangle, and the distance between the points is the hypotenuse.
Why the Distance Formula Works
In the plane, the distance formula comes straight from the Pythagorean theorem. If
and
then
so
So the formula is not a separate rule to memorize. It is the Pythagorean theorem written in coordinate form.
In 3D, you add one more perpendicular change:
That is the same idea extended into one more dimension.
Worked Example: Distance Between Two Points
Find the distance between and .
Start with the 2D distance formula:
Substitute the coordinates:
Simplify the differences:
Square and add:
So the exact distance is . As a decimal, .
A quick check helps. The points are units apart horizontally and units apart vertically, so the straight-line distance should be more than but less than . fits that.
Distance Formula in 3D
The setup is the same, but now you include the change in .
For example, between and , the coordinate changes are , , and , so
The method does not change. You subtract matching coordinates, square the differences, add them, and take the positive square root.
Common Mistakes with the Distance Formula
- Squaring before subtracting. The formula uses , not .
- Forgetting the square root. If you stop after adding the squares, you found , not .
- Mixing axes. An -coordinate must be matched with the other -coordinate, and the same goes for and .
- Losing a negative sign when substituting. For example, , not .
- Using the formula when the graph is not using standard Cartesian distance. If the axes use different scales, the geometric distance changes.
When You Use the Distance Formula
You use the distance formula in coordinate geometry whenever two points are given and the problem asks for the length of the segment between them.
Common cases include finding side lengths on a graph, checking whether a point lies on a circle, comparing distances from a center, and measuring straight-line separation in 3D geometry.
Quick Check Before You Trust the Answer
Ask two questions:
- Did I subtract first and square second?
- Is the final distance a reasonable size compared with the coordinate changes?
Those two checks catch most errors quickly.
Try a Similar Problem
Find the distance between and in 2D. Then compare your setup with the Midpoint Formula to see the difference between finding a length and finding a point halfway along the segment.
Need help with a problem?
Upload your question and get a verified, step-by-step solution in seconds.
Open GPAI Solver →