# The distance formula

The distance formula helps you calculate how far apart two points in a coordinate system are. To do this, it uses the Pythagorean theorem and its properties. Like this:

Draw a point in two dimensional Cartesian space. Now draw a line connecting that point with the point of origin. Do you see it? If not, draw a line passing through the point you selected that is perpendicular to the horizontal x-axis. You should notice that the line you just drew, together with the part of the x-axis and the line connecting your point to the point of origin, forms a right triangle. The line that connects your point and O is the hypotenuse of said triangle and the other two lines are the legs. Now, you probably remember the Pythagorean theorem from the last lesson. If not, click on the Pythagorean theorem and refresh your memory. If you do, you probably remember that the length of the hypotenuse in a right triangle can be calculated using the formula:

c2 = a2 + b2

This is the basis of the distance formula. The square of the length of the hypotenuse is the sum of squares of the lengths of both legs. The length of a leg of the triangle in a coordinate system is the distance between two points in space that are the endpoints of that particular line.  For clarity, let us call the line along the x-axis side a, and the line parallel to the y axis side b. Since none of the points that make side a do not change their position in relation to the y axis, the distance between them is simply the difference in size of the x-coordinates of the endpoints. Like this:

a = x2 – x1

And that is the length of side a. The length of side b can be calculated in much the same way, only the coordinate that remains fixed is the x-coordinate (instead of the y-coordinate, as it was with side a). That means that the length of side b is:

b = y2 – y1

Now since we know both legs, we can insert these small expressions in our equation and get:

C2 = (x2 – x1)2 + (y2 – y1)2

If you calculate the square root of this equation, you will get what is called the distance formula.

The distance formula can be applied to calculate the distance between any two points in Euclidean space and it will be very useful in many occasions.

If you wish to practice what you learned about the distance formula, please feel free to use the math worksheets below.

## The distance formula exams for teachers

 Exam Name File Size Downloads Upload date Integers The distance formula – Integers – easy 0 B 5291 January 1, 1970 The distance formula – Integers – medium 0 B 4655 January 1, 1970 The distance formula – Integers – hard 0 B 2779 January 1, 1970 The distance formula – Integers – very hard 0 B 2169 January 1, 1970 Decimals The distance formula – Decimals – easy 0 B 1365 January 1, 1970 The distance formula – Decimals – medium 0 B 1390 January 1, 1970 The distance formula – Decimals – hard 0 B 1451 January 1, 1970 The distance formula – Decimals – very hard 0 B 1185 January 1, 1970 Fractions The distance formula – Fractions – easy 0 B 1332 January 1, 1970 The distance formula – Fractions – medium 0 B 1203 January 1, 1970 The distance formula – Fractions – hard 0 B 1223 January 1, 1970

## The distance formula worksheets for students

 Worksheet Name File Size Downloads Upload date The distance formula – Integers 0 B 4958 January 1, 1970 The distance formula – Decimals 0 B 1941 January 1, 1970 The distance formula – Fractions 0 B 1449 January 1, 1970 The distance formula – Integers – Line segment 0 B 3008 January 1, 1970