Distance Between Two Points
Find the straight-line distance between two points in 2D or 3D space.
What the Distance Between Two Points does
The distance formula is the Pythagorean theorem applied to coordinates: the straight-line gap is the square root of the summed squared differences along each axis. It extends to any number of dimensions.
Formula
2D: d = √((x₂−x₁)² + (y₂−y₁)²)3D: d = √((x₂−x₁)² + (y₂−y₁)² + (z₂−z₁)²)
Inputs explained
| Input | Unit | Required | Notes |
|---|---|---|---|
| Dimensions | one of 2 options | Yes | — |
| x₁ | number | Yes | — |
| y₁ | number | Yes | — |
| z₁ | number | In some modes | Shown Dimensions is 3D (x, y, z). |
| x₂ | number | Yes | — |
| y₂ | number | Yes | — |
| z₂ | number | In some modes | Shown Dimensions is 3D (x, y, z). |
How to use it
- Choose Dimensions.
- Enter x₁, y₁, x₂ and y₂.
- Fill in the remaining inputs the form shows for your choice.
- Select Calculate.
Worked example
Distance from (1, 2) to (4, 6).
- x₁, y₁
- 1, 2
- x₂, y₂
- 4, 6
√(3² + 4²) = √25 = 5.
Reading the result
- This is the straight-line distance, which is the shortest path between two points on a flat plane.
- The formula extends to any number of dimensions by adding another squared difference under the root.
Common mistakes
- Forgetting to square the differences before adding them, which turns the result into something closer to a Manhattan distance.
- Applying it to latitude and longitude. Degrees are not a flat grid, so distances on the globe need a great-circle formula instead.
Frequently asked questions
What is Manhattan distance?
The distance travelling only along axes, like navigating a city grid: |Δx| + |Δy|. It is always at least as long as the straight line.