Advertisement

Distance between two points calculator

Measure a straight segment in a plane, or recover a missing coordinate and see both possible locations.

Calculator

Distance
5.00000000
Horizontal change
3.00000000
Vertical change
4.00000000
Midpoint x
1.50000000
Midpoint y
2.00000000
Distance calculation
ComponentChangeSquared change
Horizontal3.000000009.00000000
Vertical4.0000000016.00000000

Advertisement

How this calculator works

Coordinate differences form the legs of a right triangle. The table separates their squared contributions. In a reverse calculation, the known perpendicular separation consumes part of the squared distance; the remaining offset can point in either direction. When that offset is zero there is just one possible coordinate. All coordinates must use the same scale on perpendicular axes.

Formula

d = hypot(x₂ - x₁, y₂ - y₁). For an unknown x₂: x₂ = x₁ ± sqrt(d² - (y₂ - y₁)²). Midpoint = ((x₁ + x₂)/2, (y₁ + y₂)/2).

Worked example

From (0,0) to (3,4), the squared changes are 9 and 16, so the distance is 5. If x₁ = 1, y₁ = 2, y₂ = 6 and d = 5, x₂ can be -2 or 4.

Advertisement

Frequently asked questions

Why are there two reverse answers?

Reflecting the unknown point across the line through the known point preserves the distance and the other coordinate.

What if both points coincide?

Their distance is zero. Reverse mode also accepts zero when the known perpendicular separation is zero.

Can I enter latitude and longitude?

This is a flat Cartesian calculation. Geographic angles need an Earth-distance model and cannot be treated as equal-scale Cartesian lengths.

Sources

Advertisement