How the distance is calculated
The distance formula is Pythagoras: the gaps along each axis are the sides, and the distance is the hypotenuse.
d = √((x₂ − x₁)² + (y₂ − y₁)²)
- Find the gap along each axis: Δx = x₂ − x₁ and Δy = y₂ − y₁.
- Square each gap, add them, and take the square root.
- In 3D, add the z gap too: d = √(Δx² + Δy² + Δz²).
- The midpoint is the average of each coordinate: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2).
- For places on a map, the haversine formula finds the great-circle distance over the curved Earth, radius 6,371 km.
Worked example — From (1, 2) to (4, 6): Δx = 3 and Δy = 4, so d = √(9 + 16) = √25 = 5. The midpoint is (5/2, 4).
Common distances between points
| x₁ | y₁ | x₂ | y₂ | Distance | Exact form |
|---|---|---|---|---|---|
| 1 | 2 | 4 | 6 | 5 | 5 |
| 0 | 0 | 3 | 4 | 5 | 5 |
| -2 | 1 | 3 | -4 | 7.0711 | 5√2 |
| 0 | 0 | 1 | 1 | 1.4142 | √2 |
| 2 | 3 | 7 | 15 | 13 | 13 |
Swipe the table sideways to see the rest.
2D points. Each row is worked out by this calculator.
Things to consider
- Type fractions like 1/2 or −3/4. The answer stays exact where it can.
- The order of the points does not change the distance.
- For map coordinates, south latitudes and west longitudes are negative.
- An answer like 5√2 is exact. The decimal beside it is rounded.
Frequently asked questions
What is the distance formula?
d = √((x₂ − x₁)² + (y₂ − y₁)²). From (1, 2) to (4, 6) it gives √25 = 5.
How does the distance formula relate to Pythagoras?
Draw a right triangle with the two points at the ends of the hypotenuse. The sides are Δx and Δy, so a² + b² = c² gives the distance.
How do I find the distance between two points in 3D?
Add the z gap under the square root: d = √(Δx² + Δy² + Δz²). From (0, 0, 0) to (2, 3, 6) it is √49 = 7.
How do I find the midpoint of two points?
Average each coordinate. The midpoint of (1, 2) and (4, 6) is (5/2, 4). For the line joining them, use the Slope Intercept Form Calculator.
How do I find the distance between two latitude and longitude points?
Use the haversine formula, which measures along the curve of the Earth. Melbourne to Sydney is about 713 km in a straight line.
Why is the map distance shorter than the driving distance?
It is the straight-line distance, as the crow flies. Roads bend around terrain and towns, so driving is usually longer.
Results are estimates for general information only, not financial, medical or professional advice.
