The distance formula
It comes straight from the Pythagorean theorem: the horizontal and vertical differences form the legs of a right triangle, and the distance is the hypotenuse. In three dimensions, add (z₂ − z₁)² under the root.
The midpoint averages each coordinate: ((x₁ + x₂)/2, (y₁ + y₂)/2).
Example calculation
Example: with x₁ 0, y₁ 0, z₁ 0, x₂ 3, y₂ 4, z₂ 0, the result is Distance: 5.
| Midpoint | (1.5, 2) |
| Δx, Δy | 3, 4 |
Frequently asked questions
What is the distance formula?
d = √((x₂ − x₁)² + (y₂ − y₁)²). It comes from the Pythagorean theorem.
How do I find distance in 3D?
Add the squared z difference: d = √(Δx² + Δy² + Δz²).
What is the midpoint formula?
Average each coordinate: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2).
Can I use this for map distances?
Only over short distances on a flat grid. For places on Earth, use a great-circle distance based on latitude and longitude.
Results are calculated in your browser for general and educational use. Double-check figures before relying on them for graded work or important decisions.