Distance Formula

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.

distance between points A and B can be solved by the distance formula which is d(A,B) = sqrt ( (x2-x1)^2+(y2-y1)^2))


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.

a green right triangle with hypotenuse c (distance between two red dots) and legs a and b.
point A to point B


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

A=(x1,y1)

and

B=(x2,y2)

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].


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.

the distance "d" is actually the hypotenuse of the right triangle side where the measures of its legs are (y2-y1) and (x2-x1).

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.

  1. How far is the point [latex](6,8)[/latex] from the origin?
  2. Find the distance between the two points [latex](–3, 2)[/latex] and [latex](3, 5)[/latex].
  3. What is the distance between the two points [latex](–1, –1)[/latex] and [latex](4, –5)[/latex]?
  4. 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.
  5. Find the radius of a circle with a diameter whose endpoints are [latex](–7, 1)[/latex] and [latex](1, 3)[/latex].
  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].

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.

origin is represented by the ordered pair (0,0) while the other point by the ordered pair (6,8)

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.

the distance between (0,0) and (6,8) is 10 units

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,

d = square root of  = square root of (6^2 + 3^2) = square root of (36 + 9) = square root of (45) = 3 times square root of 5.

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.

the hypotenuse of the right triangle is 3 times the square root of 5 which is approximate 6.71

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

for the point (-1,-1), the x-coordinate is negative 1 (-1) while the y-coordinate is also negative 1 (-1)

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

the point (4,-5) has the x-coordinate of positive 4 (+4) and the y-coordinate of negative 5 (-5)

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

distance is equal to the square root of 41

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.

a right triangle with the hypotenuse having endpoints of (-1,-1) and (4,-5). the change in y is -4 while the change in x is 5.

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:
first point is (-4,-2)
second point is (4,3)
d=sqrt((x2-x1)^2+(y2-y1)^2) = sqrt(8^2+6^2) = 10 units.

  • Solution 2:
the second point becomes the first point which is now (4,3) from (-4,-3)
the first point becomes the second point which is now (-4,-3) from (4,3)
d = sqrt = sqrt = sqrt (64 + 36) = sqrt(100) = 10.


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.

the distance between the two points is the hypotenuse where d=10.

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.

 r = (1/2)d where r is the radius while d is 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].
d = 2 sqrt(17)
  • Solve for the radius by dividing the diameter by [latex]2[/latex].
radius = (1/2) [2 sqrt(17)] = sqrt(17).
  • 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].
the circle with a center of (-3,2), with endpoints of the diameter of (-7,1) and (1,3), and with a radius as solved before as sqrt(17)

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.

1st point is (3,2) which implies x1=3 and x2=2 while 2nd point is (x,-3) which implies x2=x and y2=-4

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.

10=sqrt(x^2-6x+45)

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].

0=(x-11)(x+5)

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].

graph showing a circle centered at (3,2) and two radii with length 10 units going to the points on the circle (-5,-4) and (11,-4)

You might also like these tutorials: