3D Distance Calculator
Find the distance between two points in 3D space, the distance from a point to a plane, a vector’s length, or the dimensions of a bounding box — with the midpoint, exact radical form, direction angles and alternative distance measures (Manhattan, Chebyshev, Minkowski).
Written by Suhaib Hassan. The formulas are standard analytic geometry, and each worked example is re-derived by hand. Our methodology.
It subtracts coordinates, squares and adds the differences, and takes the square root; whole-number and simplified radical forms are found exactly.
3D distance is the Pythagorean theorem applied twice. This page shows that working and the related measures used in graphics, robotics and CAD.
—
3D diagram
Oblique projection with the bounding box of the two points.
Step-by-step working
—
Distance metrics compared
Different ways to measure “how far”, shown for the displacement (Δx, Δy, Δz) = (1, 2, 3).
| Metric | Formula | Path | Value for (1, 2, 3) | Used in |
|---|---|---|---|---|
| Euclidean (L²) | √(Δx² + Δy² + Δz²) | Straight line | √14 ≈ 3.7417 | Physics, graphics, CAD |
| Manhattan (L¹) | |Δx| + |Δy| + |Δz| | Along axes only | 6 | Grid routing, warehouse paths |
| Chebyshev (L∞) | max(|Δx|, |Δy|, |Δz|) | Independent axis moves | 3 | Gantry machines, chessboard king |
| Minkowski (p = 3) | (|Δx|³ + |Δy|³ + |Δz|³)^(1/3) | Generalised | 36^(1/3) ≈ 3.3019 | Machine learning, clustering |
Worked examples
Two aircraft
Positions (1, 2, 3) and (5, 6, 9) km.
d² = 16 + 16 + 36 = 68
d = √68 = 2√17 ≈ 8.2462 km
Box diagonal
The longest straight item that fits in a 3 × 4 × 12 cm box.
Point to plane
Distance from (1, 2, 3) to the plane 2x − y + 2z − 4 = 0.
= 2 ÷ 3 = 0.6667
What is 3D distance?
The straight-line distance between (x₁, y₁, z₁) and (x₂, y₂, z₂) is d = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²]. It follows from applying the Pythagorean theorem twice: first across the floor (Δx, Δy), then up the height (Δz).
Point-to-plane distance
For a plane Ax + By + Cz + D = 0 and a point (x₀, y₀, z₀), the shortest distance is |Ax₀ + By₀ + Cz₀ + D| ÷ √(A² + B² + C²). The foot of the perpendicular is the point minus the signed distance times the unit normal.
By Suhaib Hassan · Reviewed 28 September 2026 · How CalculatePilot verifies formulas →
Sources
- Euclid, Elements, Book XI — foundations of solid geometry and orthogonal spatial projection.
- ISO 80000-2:2019, Quantities and units — Part 2: Mathematics.
- NIST Special Publication 811, Guide for the Use of the International System of Units (SI) — length units.
Frequently asked questions
How does 3D distance differ from 2D distance?
In 2D you use √(Δx² + Δy²). In 3D a third term Δz² is added under the root. Geometrically, the 2D distance becomes one leg of a right triangle whose other leg is the height difference.
What is the difference between Euclidean and Manhattan distance?
Euclidean distance is the straight-line “as the crow flies” length. Manhattan distance sums the absolute coordinate differences, the length of a path that moves along the axes only, like streets in a grid. Manhattan is never shorter than Euclidean.
What are direction cosines?
They are the cosines of the angles the displacement makes with the x, y and z axes: cos α = Δx ÷ d, cos β = Δy ÷ d, cos γ = Δz ÷ d. They always satisfy cos²α + cos²β + cos²γ = 1 and give the unit vector along the line.
What are the spherical coordinates of a displacement?
The distance r = d, the azimuth θ = atan2(Δy, Δx) measured in the xy-plane, and the polar angle φ = arccos(Δz ÷ d) measured from the +z axis.
What if the plane equation is entered as ax + by + cz = k?
Move k to the left: enter D = −k. For example 2x − y + 2z = 4 becomes A = 2, B = −1, C = 2, D = −4.
Does the unit matter?
No, as long as all coordinates use the same unit. The unit box is only a label copied into the results; the arithmetic is unit-free.
Related calculators
Continue with geometry and vectors.