The distance between two points can be calculated using the distance formula. In turn, the distance formula is derived using the Pythagorean theorem in the Cartesian plane, where the distance represents the hypotenuse of a right triangle and the distances in *x* and *y* represent the legs of the triangle.

Here, we will learn how to derive the formula for the distance between two points. Also, we will use this formula to solve some practice problems.

## Formula for the distance between two points

The distance between two points with coordinates and can be calculated using the distance formula.

Distance formula |

This is the formula that can be applied in the Cartesian plane, that is, in two-dimensional space. Additionally, if we want to calculate the distance between two points located in the three-dimensional plane, we have to use the distance formula in 3D:

Distance formula in 3D |

## How to derive the formula for the distance between two points?

To derive the formula for the distance between two points, we have to use the Pythagorean theorem on the Cartesian plane. Therefore, we are going to use the following diagram:

In the diagram, we have the points and . We join these points with the segment AB, which we can denote with *d*. Then, we construct a right triangle where the segment AB is the hypotenuse and the segments AC and BC are the legs of the triangle.

When we apply the Pythagorean theorem to triangle ABC, we have:

We can see that the vertical distance between the points is equal to and the horizontal distance between the points is equal to . Also, if we substitute AB with *d *, we have:

Now, we take the square root of both sides to get the distance formula:

Start now: Explore our additional Mathematics resources

## Examples with answers of distances between two points

The distance formula is used in the following examples to obtain the distance between two points. Each example has its respective solution, but it is recommended that you try to solve the problems yourself to practice.

**EXAMPLE 1**

Determine the distance between the points (1, 3) and (5, 6).

##### Solution

We write the coordinates of the points as follows:

Using the distance formula with these values, we have:

The distance between the points is equal to 5.

**EXAMPLE 2**

What is the distance between the points (2, 6) and (7, 10)?

##### Solution

We can write the coordinates of the points as follows:

We apply the distance formula with the given coordinates:

The distance is equal to 7.14.

**EXAMPLE 3**

If we have the points (12, 2) and (5, 5), what is their distance?

##### Solution

We can observe the following coordinates:

When we substitute these values into the distance formula, we have:

The distance between the points is equal to 7.62.

**EXAMPLE 4**

Find the distance between the points (-4, 5) and (4, 9).

##### Solution

We have the following coordinates:

Here, we have a point with negative coordinates. However, the distance formula can be used regardless of the coordinate signs.

The distance is equal to 8.94.

**EXAMPLE 5**

Determine the distance between the points (-6, -7) and (-2, -1).

##### Solution

We have the following coordinates:

Similar to the previous example, we just have to use the distance formula with the given coordinates.

The distance is equal to 7.21.

## Distance between two points – Practice problems

The following problems can be solved using what has been learned about the distance between two points. You can look at the distance formula written above or the solved examples in case you need help.

## See also

Interested in learning more about the midpoint, slope, and distance on the plane? Take a look at these pages:

### Learn mathematics with our additional resources in different topics

**LEARN MORE**