The Distance Formula

The Distance Formula is a method for determining the distance between two points, which can be represented as point \(A\) \((x_1, y_1)\) and point \(B\) \((x_2, y_2)\) on a coordinate plane.
If you already have this skill, you can test your knowledge by attempting the practice problems provided.

The Distance Formula is derived from the Pythagorean Theorem, which states that \({a^2} + {b^2} = {c^2}\), where \(c\) is the longest side of a right triangle (the hypotenuse), and \(a\) and \(b\) are the other two sides (the legs of the right triangle).
The main purpose of the Distance Formula is to calculate the length of the hypotenuse, represented by the letter \(c\), in a right triangle.


That’s why we can say that the concept of the Distance Formula is borrowed and derived from the Pythagorean Theorem. If you’d like to see how the Distance Formula is derived from the Pythagorean Theorem, please check out my lesson on deriving the Distance Formula.
Distance Formula as the Derivative of the Pythagorean Theorem
The distance [latex]d[/latex] between two points

and

is calculated or computed using the following formula:
![Distance is equal to the square root of the sum of the quantity the square of the difference of x-coordinates and the square of the difference of the y-coordinates. Or in short, d=sqrt[(x2-x1)^2 + (y2-y1)^2].](https://www.chilimath.com/wp-content/uploads/2018/12/the_distance_formula.png)
Below is an illustration demonstrating that the Distance Formula is based on the Pythagorean Theorem, where the distance \(d\) represents the hypotenuse of a right triangle.

Observations:
a) The expression [latex]{x_2} – {x_1}[/latex] is read as the “change in [latex]x[/latex]”.
b) The expression [latex]{y_2} – {y_1}[/latex] is read as the “change in [latex]y[/latex]”.
In addition to the examples below, I’ve also created more practice problems for the Distance Formula, which you can find at the link provided below.
Distance Formula Practice Problems with Answers
Examples of Using the Distance Formula
Below is a list of all the problems in this lesson.
- How far is the point [latex](6,8)[/latex] from the origin?
- Find the distance between the two points [latex](–3, 2)[/latex] and [latex](3, 5)[/latex].
- What is the distance between the two points [latex](–1, –1)[/latex] and [latex](4, –5)[/latex]?
- How far apart are the points [latex](–4, –3)[/latex] and [latex](4, 3)[/latex]? Solve in two different ways and show that the final answer is the same.
- Find the radius of a circle with a diameter whose endpoints are [latex](–7, 1)[/latex] and [latex](1, 3)[/latex].
- Find the two points of the form [latex]\left( {{\color{red}{x}},-4} \right)[/latex] that have the same distance of [latex]10[/latex] from the point [latex]\left( {3,2} \right)[/latex].
Example 1: How far is the point \((6,8)\) from the origin?
The origin is marked by a red dot with an x-coordinate of \(0\) and a y-coordinate of \(0\). This point can be written as the ordered pair \(\color{red}(0,0)\).
The other point is represented by a blue dot with an x-coordinate of \(6\) and a y-coordinate of \(8\), which can be written as the ordered pair \(\color{blue}(6,8)\).
If we plot the points \(\color{red}(0,0)\) and \(\color{blue}(6,8)\) on a Cartesian plane, we will get a diagram similar to the one shown below.

If we let the origin be the first point, then we have \(\left( x_1, y_1 \right) = (0,0)\), which means \(x_1 = 0\) and \(y_1 = 0\).
Similarly, the second point would be \((6,8)\). Therefore, \(\left( x_2, y_2 \right) = (6,8)\), which implies \(x_2 = 6\) and \(y_2 = 8\).
Now, we substitute these values into the Distance Formula and simplify to find the distance between the two points.

Therefore, point \((6,8)\) is \(10\) away from the origin.
Example 2: Find the distance between the two points (–3, 2) and (3, 5).
Label the parts of each point properly and substitute it into the distance formula.
If we let [latex]\left( { – 3,2} \right)[/latex] be the first point then it will take the subscript of 1, thus, [latex]{x_1} = – 3[/latex] and [latex]{y_1} = 2[/latex].
Similarly, if [latex]\left( {3,5} \right)[/latex] be the second point it will have the subscript of 2, thus, [latex]{x_2} = 3[/latex] and [latex]{y_2} = 5[/latex].
Here is the calculation,

Therefore, the distance between two points (–3, 2) and (3, 5) is [latex]3\sqrt 5[/latex] . This is how it looks on a graph.

Example 3: What is the distance between the points \((–1, –1)\) and \((4, –5)\)?
If we assign [latex]\left( { – 1, – 1} \right)[/latex] as our first point then

In the same manner, assigning [latex]\left( {4, – 5} \right)[/latex] as our second point, we have

Plugging in the values of [latex]x[/latex] and [latex]y[/latex], we get:

The two points and the distance between them which is [latex]\sqrt {41}[/latex] can be shown on a graph just like the one below.

Example 4: How far apart are two points \((–4, –3)\) and \((4, 3)\) from each other? Solve in two different ways and show that the distance is the same.
You might wonder if swapping the points when calculating the distance affects the final result.
To understand this, let’s look at the formula. It involves squaring the differences between the corresponding \(x\) and \(y\) values. This means that whether delta \(x\) or delta \(y\) (the changes in \(x\) and \(y\), respectively) are negative or positive doesn’t matter. Once we square these differences, the result is always positive.
To demonstrate this, let’s solve a problem two different ways and see that the answer remains consistent!
The first solution follows the standard approach because we assign the first and second points based on the order they are presented in the problem. In the second solution, we reverse the order of the points.
- Solution 1:



- Solution 2:



As you can see, both solutions yield the same result, which is a distance of \(10\), with \(d = 10\). Below is a visual representation of the solution to the problem.

Example 5: Find the radius of a circle with a diameter whose endpoints are \((–7, 1)\) and \((1, 3)\).
Remember that the diameter of a circle is twice the length of its radius. If that’s the case, then the radius is half the length of the diameter.

Here’s the plan! Since we are given the endpoints of the diameter, we can use the distance formula to find its length. Finally, we divide it by 2 to get the length of the radius, as required by the problem.
- Find the length of the diameter with endpoints [latex]\left( { – 7,1} \right)[/latex] and [latex]\left( {1,3} \right)[/latex].

- Solve for the radius by dividing the diameter by [latex]2[/latex].
![radius = (1/2) [2 sqrt(17)] = sqrt(17).](https://www.chilimath.com/wp-content/uploads/2019/02/distance-example4-solution2.png)
- The blue dots are the endpoints of diameter and the green dot is the center of the circle (calculated using the midpoint formula) located at [latex]\left( { – 3,2} \right)[/latex].

Example 6: Find the two points of the form [latex]\left( {{\color{red}{x}},-4} \right)[/latex] that have the same distance of [latex]10[/latex] from the point [latex]\left( {3,2} \right)[/latex].
This problem is a bit different from the others because one of the points, specifically \(\left( {x, -4} \right)\), includes a variable, \(\large\color{red}x\), rather than a specific number.
I recommend tackling this problem the same way you did the previous ones. Start by deciding which point will be the first and which will be the second, labeling them as \(\left( {x_1, y_1} \right)\) and \(\left( {x_2, y_2} \right)\), respectively. Then, substitute these values into the formula and solve.
Here, you’ll quickly notice that you won’t end up with a numerical value for the distance. Instead, you’ll need to solve a quadratic equation to find two solutions. Be cautious: neither of these solutions represents a distance. They are the x-coordinates of two different points. Remember, the x-coordinate is always the first number in an ordered pair, \(\left( {\color{red}{x}, y} \right)\).
You have the flexibility to choose which point to label as the first and which as the second. The order doesn’t matter because, as shown in Example #4, the result will be the same regardless of your choice.
Remember, the Distance Formula is constructed as follows:
- the second x-coordinate subtracted by the first x-coordinate
- the second y-coordinate subtracted by the first y-coordinate
It makes sense for us to let the point [latex]\left( {{\color{red}{x}},-4} \right)[/latex] be the second point while [latex]\left( {3,2} \right)[/latex] be the first point.
By doing so, we will have a situation where the variable [latex]\color{red}x[/latex] is being subtracted by the number [latex]3[/latex]. Thus, [latex]x-3[/latex]. This is great because the coefficient of the variable [latex]\color{red}{x}[/latex] is positive.

Don’t forget that the two points have the same distance of [latex]10[/latex] from [latex](3,2)[/latex].
We substitute the values above into the Distance Formula below then simplify.

Now, square both sides of the equation to get rid of the square root symbol on the right side. Next, subtract both sides by [latex]100[/latex] to make the left side equal to [latex]0[/latex]. Finally, factor out the trinomial on the right side then set each factor equal to [latex]0[/latex] to solve for [latex]x[/latex].

Therefore, the two points [latex]\left( {{\color{red}{11}},-4} \right)[/latex] and [latex]\left( {{\color{red}{-5}},-4} \right)[/latex] both have the same distance of [latex]\color{blue}10[/latex] from the point [latex]\left( {3,2} \right)[/latex].
I will leave it to you to verify that the distance between [latex]{\left( {11, – \,4} \right)}[/latex] and [latex]{\left( {3,2} \right)}[/latex], and between [latex]{\left( { – 5, – \,4} \right)}[/latex] and [latex]{\left( {3,2} \right)}[/latex] are both [latex]10[/latex].

You might also like these tutorials:
- Distance Formula Practice Problems with Answers
- Derivation of the Distance Formula
- Distance between Point and Line Formula
- Midpoint Formula