Distance Between Two Points

The straight-line distance between two points on a plane.

Result

Distance

5.0000

How it works

d = √((x₂−x₁)² + (y₂−y₁)²)

The distance between two points in a plane is the Pythagorean theorem in disguise: d = √((x₂−x₁)² + (y₂−y₁)²). Draw the horizontal and vertical gaps between the points and you have a right triangle whose hypotenuse is the distance you want. From (1,2) to (4,6), the gaps are 3 and 4, so the distance is √(9+16) = 5 — the classic 3-4-5 triangle. Squaring the differences also removes any sign problem: the order of the two points never changes the result. The formula extends naturally to three dimensions by adding a term: d = √(Δx² + Δy² + Δz²). It underpins computer graphics, collision detection in games, nearest-neighbour searches and clustering algorithms — anywhere a machine needs to know "how far apart?".

Advertisement

Frequently asked questions

Where does the formula come from?

From Pythagoras — the distance is the hypotenuse of a right triangle formed by the x and y differences.

Does it work in 3D?

The same idea extends to 3D by adding a (z₂−z₁)² term; this tool covers the 2D case.

Does the order of the points matter?

No. The differences are squared, so a negative gap gives the same result as a positive one — the distance from A to B always equals the distance from B to A.

Advertisement

Related calculators