Distance in three dimensions
Find straight-line distance between two points in three-dimensional Cartesian space.
Distance in three dimensions is one of 3 coordinates formulas in the geometry section of this library, and it is used at high school · university level.
Why distance in three dimensions works
Travel from one point to the other in two stages: first move within a level plane, then rise straight up. Those two stages meet at a right angle, so the Pythagorean relation applies once inside the plane and again for the climb, and the two uses collapse into a single root of three squared differences.
What each symbol means
$(x_i,y_i,z_i)$ are endpoint coordinates.
Distance in three dimensions: when it holds
All coordinate axes must use the same length scale.
When it stops applying
All three axes must meet at right angles and share one unit of length. Latitude, longitude and altitude do not satisfy that, so applying this straight-line rule to map coordinates misreports distances on the curved Earth.
Distance in three dimensions: a worked example
Between $(0,0,0)$ and $(1,2,2)$, $d=\sqrt9=3$.
The mistake to avoid
What people do: Taking the square root of each coordinate difference and adding those roots.
Why it goes wrong: Roots do not combine that way: from the origin to (1,2,2) it gives about 3.83 when the true separation is exactly 3.
Do this instead: Square all three differences, add the three squares together, and take one root of that single total.
Distance in three dimensions: step by step
- Name the unknown, and the unit the answer has to come out in.
- Match the symbols to your values. $(x_i,y_i,z_i)$ are endpoint coordinates.
- Check the conditions before substituting. All coordinate axes must use the same length scale.
- Substitute, keep exact values to the last line, then test the sign, size, and unit against a rough estimate — the check that catches most geometry slips.
Where this formula fits
- Subject
- Geometry formulas — 30 entries in this library
- Topic
- Coordinates
- Level
- High school · University
Formulas are easiest to keep when they sit inside a method rather than on a list. Use the links below to see where distance in three dimensions comes from, to check a calculation against a tool, and to practise it until you can recall it without looking.
- Equation of a Circle — the lesson behind this formula: read and build circle equations on the coordinate plane.
- Geometry Calculator — check your substitution and the value it produces.
- Study geometry — the subject guide that explains the ideas these formulas compress.
- Geometry Practice — questions that make you retrieve the formula instead of recognising it.
- All 30 geometry formulas — the full grouped reference, or the complete formula library.
Questions about distance in three dimensions
How does this extend beyond three coordinates?
Keep adding squared differences under the same root. The pattern continues unchanged for any number of coordinates.
How do I find the length of a vector in space?
Treat the origin as one of the two points, so the length is the root of the sum of the three squared components.
Why is the distance from the origin to (1,2,2) a whole number?
Because 1 plus 4 plus 4 lands exactly on 9. Such neat triples are much rarer in space than the familiar 3-4-5 pattern in the plane.
How far is a point from a coordinate plane?
Read one coordinate off directly. The distance to the horizontal plane is the size of the height coordinate, since the other two differences are zero.