Overview
The distance formula extends to three dimensions by adding a third squared difference.
Enter the coordinates of both points.
Worked examples
| Inputs | Result |
|---|---|
| x₁1y₁2z₁3x₂4y₂6z₂15 | Distance: 13Midpoint: (2.5, 4, 9) |
Show 2 more examples
| x₁0y₁0z₁0x₂1y₂1z₂1 | Distance: 1.73205Midpoint: (0.5, 0.5, 0.5) |
| x₁-3y₁4z₁2x₂5y₂-1z₂7 | Distance: 10.6771Midpoint: (1, 1.5, 4.5) |
Distance by z₂
With the calculator's starting values, the distance is 13. The table shows how it changes with the z₂.
| z₂ | Distance |
|---|---|
| 8 | 7.07107 |
| 10 | 8.60233 |
| 12 | 10.2956 |
| 14 | 12.083 |
| 15starting value | 13 |
| 16 | 13.9284 |
| 18 | 15.8114 |
| 20 | 17.72 |
| 22 | 19.6469 |
Other inputs: x₁: 1 · y₁: 2 · z₁: 3 · x₂: 4 · y₂: 6. Change them in the calculator above for your own numbers.
How it works
Distance is the Pythagorean theorem applied twice. The midpoint averages each coordinate.
The formula
d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²)
| (x, y, z) | Point coordinates |
Practical tips
- (1, 2, 3) to (4, 6, 15) is exactly 13.
- Used in 3D games, robotics and CAD.
- Keep the same units on all axes.
Frequently asked questions
What about 2D?
Set both z values to 0, or use the distance formula calculator.
What is the midpoint?
The point halfway along the line between them.