The Distance Formula

The Distance Formula is a useful tool in finding the distance between two points which can be arbitrarily represented as points \left( {{x_1},{y_1}} \right) and \left( {{x_2},{y_2}} \right).

The Distance Formula itself is actually derived from the Pythagorean Theorem which is {a^2} + {b^2} = {c^2} where c is the longest side of a right triangle (also known as the hypotenuse) and a and b are the other shorter sides (known as the legs of a right triangle).

The very essence of the Distance Formula is to calculate the length of the hypotenuse of the right triangle which is represented by the letter c.

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

That’s why we can claim that the idea of the Distance Formula is borrowed and derived from the Pythagorean Theorem. If you want to see how the Distance Formula is derived from the Pythagorean Theorem, please check out my lesson on How to Derive the Distance Formula.


Distance Formula as the Derivative of the Pythagorean Theorem

The distance d 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 showing that the Distance Formula is based on the Pythagorean Theorem where the distance d is 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 {x_2} - {x_1} is read as the “change in x“.

b) The expression {y_2} - {y_1} is read as the “change in y“.


Examples of Using the Distance Formula

Below is a list of all the problems in this lesson.

  1. How far is the point (6,8) from the origin?
  2. Find the distance between the two points (–3, 2) and (3, 5).
  3. What is the distance between the points (–1, –1) and (4, –5)?
  4. How many units apart are the points (–4, –3) and (4, 3)? 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 (–7, 1) and (1, 3).
  6. Find the two points of the form \left( {{\color{red}{x}},-4} \right) that have the same distance of 10 units from the point \left( {3,2} \right).

Example 1

How far is the point (6,8) from the origin?

The origin is the red dot with x-coordinate of 0 and y-coordinate of 0. We can write it in ordered pair as \color{red}\left( {0,0} \right).

While the other point is the blue dot having an x-coordinate of 6 and y-coordinate of 8. Similarly, this can be written as the ordered pair \color{blue}\left( {6,8} \right).

If we plot the points \color{red}\left( {0,0} \right) and \color{blue}\left( {6,8} \right) on a Cartesian Plane, we will get something similar to the one 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) = \left( {0,0} \right) which implies {x_1} = 0 and {y_1} = 0.

Consequently, the second point would be \left( {6,8} \right). Therefore, \left( {{x_2},{y_2}} \right) = \left( {6,8} \right) which means {x_2} = 6 and {y_2} = 8.

Now, we substitute the values into the Distance Formula then simplify to get the distance between the two points in question.

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

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 \left( { - 3,2} \right) be the first point then it will take the subscript of 1, thus, {x_1} = - 3 and {y_1} = 2.

Similarly, if \left( {3,5} \right) be the second point it will have the subscript of 2, thus, {x_2} = 3 and {y_2} = 5.

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 3\sqrt 5 . 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 \left( { - 1, - 1} \right) 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 \left( {4, - 5} \right) 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 x and y, we get:

distance is equal to the square root of 41

The two points and the distance between them which is \sqrt {41} 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 many units apart are the points (–4, –3) and (4, 3)? Solve in two different ways and show that the final answer is the same.

Sometimes you may wonder if switching the points in calculating the distance can affect the final outcome.

Well, if you think about it, the formula is squaring the difference of the corresponding x and y values. That means it doesn’t matter if the change in x, also known as delta x, or the change in y, also known as delta y, is negative because when we eventually square it (raise to the 2nd power), the result always comes out to be positive.

Let’s “prove” that the answer is always the same by solving this problem in two ways!

The first solution shows the usual way because we assign which point is the first and second based on the order in which they are given to us in the problem. In the second solution, we switch 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.

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.

10 units

As you can see, both solutions arrived at the same answer or result which is the distance of 10, d = 10. Below is the visual 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 \left( { - 7,1} \right) and \left( {1,3} \right).
d = 2 sqrt(17)
  • Solve for the radius by dividing the diameter by 2.
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 \left( { - 3,2} \right).
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 \left( {{\color{red}{x}},-4} \right) that have the same distance of 10 units from the point \left( {3,2} \right).

This problem is slightly different. Notice that one point, namely \left( {x, - \,4} \right), contains the variable \large\color{red}x instead of a specific number.

I suggest that you approach this just the same as the previous problems. Now, assign which of the points will be the first and second, that is, \left( {{x_1},{y_1}} \right) and \left( {{x_2},{y_2}} \right), respectively. Then substitute the values into the formula and solve.

In this case, you will see immediately that you won’t get a value as the distance. Instead, you will have to solve a quadratic equation to obtain two numbers. Be careful here. Either of the two numbers doesn’t represent a distance. The two numbers will be the x-coordinates of two points. Remember that x-coordinate is always the first value of the ordered pair \left( {{\color{red}{x}},y} \right)

It’s up to you to designate which one is going to be the first point, therefore forcing the other point to be the second.

It’s doesn’t matter which of the two points you select as the first or second point because the outcome will always be the same as shown in Example #4.

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 \left( {{\color{red}{x}},-4} \right) be the second point while \left( {3,2} \right) be the first point.

By doing so, we will have a situation where the variable \color{red}x is being subtracted by the number 3. Thus, x-3. This is great because the coefficient of the variable \color{red}{x} 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 10 units from (3,2).

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 100 to make the left side equal to 0. Finally, factor out the trinomial on the right side then set each factor equal to 0 to solve for x.

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

Therefore, the two points \left( {{\color{red}{11}},-4} \right) and \left( {{\color{red}{-5}},-4} \right) both have the same distance of \color{blue}10 units from the point \left( {3,2} \right).

I will leave it to you to verify that the distance between {\left( {11, - \,4} \right)} and {\left( {3,2} \right)}, and between points {\left( { - 5, - \,4} \right)} and {\left( {3,2} \right)} are both 10 units.

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)


Practice with Worksheets

You might also be interested in:

Derivation of the Distance Formula