3D Distance Calculator
Find the straight-line distance between two points in 3D space.
3D distance formula
Enter two points in 3-D space
Point 1 (P₁)
Point 2 (P₂)
What is 3-D distance?
Three-dimensional distance is the straight-line length between two points (x₁, y₁, z₁) and (x₂, y₂, z₂) in 3-D space. It generalises the familiar 2-D distance formula by adding a Δz² term under the square root: d = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²]. The same Pythagorean theorem is applied twice — once in the horizontal xy-plane to get the diagonal shadow of the segment, and then once more between that shadow and the vertical z-gap to get the full hypotenuse.
Three-dimensional distance shows up everywhere physical space is modelled: a CAD designer measuring two corners of an assembly, a chemist computing the bond length between two atoms, a robotics engineer fitting a robotic arm into a workspace, a flight planner working out the slant range between an aircraft and a runway, a graphics programmer testing whether the camera intersects a model. In each case the answer is the same √(Δx² + Δy² + Δz²) — only the units and the interpretation change.
How the 3-D distance calculator works
Enter both points
Type the (x, y, z) coordinates of the start and end points. The same coordinate system and the same unit must be used for all six values.
Read the distance and breakdown
The headline is the straight-line distance. The breakdown panel shows Δx, Δy, Δz, the magnitude of the direction vector, the unit vector, and the midpoint.
Inspect direction cosines
The direction cosines cos α, cos β, cos γ tell you the angle the segment makes with each coordinate axis. They always satisfy cos²α + cos²β + cos²γ = 1.
Rotate the isometric view
The SVG isometric scene lets you drag to rotate around the vertical axis so you can see the segment from different sides without losing track of which axis is which.
Formulas inside this tool
3-D distance
d = √[(x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²]
Pythagoras applied twice — once in the xy-plane, then with the z-gap.
Direction vector
v = ⟨Δx, Δy, Δz⟩
The displacement from P₁ to P₂ written as a single vector.
Magnitude
‖v‖ = d
The length of the direction vector equals the 3-D distance.
Unit vector
v̂ = v / ‖v‖
A length-1 vector pointing the same way as v — direction without magnitude.
Direction cosines
cos α = Δx/d, cos β = Δy/d, cos γ = Δz/d
Angles α, β, γ are the angles the segment makes with the x, y, z axes.
Midpoint
M = ((x₁+x₂)/2, (y₁+y₂)/2, (z₁+z₂)/2)
Average each coordinate independently.
Where 3-D distance shows up
Computer graphics
Lighting equations, frustum culling, ray-sphere intersection, collision detection — every step that touches a 3-D scene uses Euclidean distance under the hood.
Chemistry and biology
Bond lengths in a molecule, distances between atoms in protein-folding models, drug-binding pocket geometry — all measured with the 3-D distance formula on Ångström-scale coordinates.
Surveying and construction
Total stations record 3-D coordinates of every reference point on a site; 3-D distance tells the foreman how far apart two corner stakes really are once height is included.
Aviation and aerospace
Slant range between aircraft and runway, distance to a satellite, plane-to-plane separation in 3-D traffic-management systems.
Why a calculator instead of mental arithmetic?
Squaring three numbers, summing, and taking a square root is mechanical, but easy to slip on under pressure — especially when one of the coordinates is negative, when the values are large, or when the difference Δz is much smaller than Δx and Δy. This calculator keeps every intermediate value visible so you can spot a typo immediately and shows the equivalent unit vector and direction cosines so you can also reason about direction, not just distance.
Frequently Asked Questions
Related Calculators
More coordinate-geometry, trig, and unit tools that pair with distance calculations.
- Distance Calculator2D, 3D, lat/lng, map, vector, and geometry distance — six tools, step-by-step solutions, interactive visualisations.
- Pythagorean Theorem CalculatorSolve any side of a right triangle, plus area, perimeter, and angles.
- Slope CalculatorSlope, angle, distance, midpoint, intercepts, and the line equation with an interactive coordinate-plane graph.
- Triangle CalculatorSolve any triangle (SSS, SAS, ASA, AAS, SSA) for sides, angles, area, altitudes, medians, inradius, circumradius and centres.
- Circle CalculatorFind area, circumference, diameter, and radius from any one known value.
- Scientific CalculatorAdvanced trig, log, exponent, root, factorial, and memory functions.