CCalclabhub

Coordinate Geometry

Distance between two points

Pythagoras with the coordinate differences as the two legs. Order of the points does not matter.

Last updated

The Formula

d = sqrt((x2 - x1)^2 + (y2 - y1)^2)

Pythagoras with the coordinate differences as the two legs. Order of the points does not matter.

SymbolMeaning
dDistance
x1First x
y1First y
x2Second x
y2Second y

What Each Symbol Means

dunits

Distance

Straight line length between the points.

x1units

First x

Horizontal coordinate of the first point.

y1units

First y

Vertical coordinate of the first point.

x2units

Second x

Horizontal coordinate of the second point.

y2units

Second y

Vertical coordinate of the second point.

See It Worked With Real Numbers

A formula on its own does not tell you which number goes where. The how to calculate the distance between two points page applies this equation to a concrete case, shows every intermediate step, and names the mistakes that produce a wrong answer even when the algebra is right.

Where This Formula Appears

This equation is the working core of How To Calculate The Distance Between Two Points, filed under Math. Every number the guide produces comes from substituting into this one line.

Common Questions

What is the formula for Distance between two points?

The formula for Distance between two points is d = sqrt((x2 - x1)^2 + (y2 - y1)^2). Pythagoras with the coordinate differences as the two legs. Order of the points does not matter.

What does each symbol in Distance between two points stand for?

d is distance; x1 is first x; y1 is first y; x2 is second x; y2 is second y.

What units should I use with Distance between two points?

Substitute d in units, x1 in units, y1 in units, x2 in units, y2 in units. Convert every input to those units before you start, because the equation only returns the right answer when the units on both sides agree.

What is a common mistake when using Distance between two points?

Adding the differences before squaring. Square each difference first. Adding and then squaring gives a much larger number and is the most common slip with a one line formula.