The 3D distance formula extends the Pythagorean theorem to space: drone flight paths, the length of a diagonal brace, distances between atoms or between objects in a 3D model.
How to use the Three-Dimensional Distance Calculator
- X₁
- Y₁
- Z₁
- X₂
- Y₂
- Z₂
Results update as you type, and everything is calculated in your browser.
How it works
Square the differences in each coordinate, add them and take the square root.
Inputs explained
| Field | What to enter |
|---|---|
| X₁ | A number |
| Y₁ | A number |
| Z₁ | A number |
| X₂ | A number |
| Y₂ | A number |
| Z₂ | A number |
What each result means
- Distance D = sqrt(([X₂] – [X₁])^2 + ([Y₂] – [Y₁])^2 + ([Z₂] – [Z₁])^2)
- Δx = [X₂] – [X₁]
- Δy = [Y₂] – [Y₁]
- Δz = [Z₂] – [Z₁]
- Midpoint – x = ([X₁] + [X₂])÷2
- Midpoint – y = ([Y₁] + [Y₂])÷2
- Midpoint – z = ([Z₁] + [Z₂])÷2
Example values
How the main result changes when X₁ changes and everything else stays at the example values above:
| X₁ | Distance D |
|---|---|
| 0.5 | 13.1244 |
| 0.75 | 13.06 |
| 1 | 13 |
| 1.25 | 12.9446 |
| 1.5 | 12.8938 |
| 2 | 12.8062 |
Formula
D = √[(x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²]
Worked example
Inputs — X₁: 1; Y₁: 2; Z₁: 3; X₂: 4; Y₂: 6; Z₂: 15.
Results — Distance D = 13; Δx = 3; Δy = 4; Δz = 12; Midpoint – x = 2.5; Midpoint – y = 4; Midpoint – z = 9.
Key terms
- Euclidean distance
- Straight-line distance.
Frequently asked questions
What is the distance between (1, 2, 3) and (4, 6, 15)?
√(9 + 16 + 144) = 13.
Does it work with negative coordinates?
Yes – differences are squared.
How is it related to the 2D formula?
It adds a (Δz)² term.
What is the diagonal of a box l × w × h?
√(l² + w² + h²) – the distance between opposite corners.