# 3.6: The Distance Formula

**At Grade**Created by: CK-12

## Learning Objectives

- Find the distance between two points.
- Find the shortest distance between vertical and horizontal lines and
- Find the shortest distance between parallel lines with slope of 1 or -1.

## Review Queue

- What is the slope of the line between (-1, 3) and (2, -9)?
- Find the equation of the line that is
*perpendicular*to \begin{align*}y=-2x+5\end{align*}y=−2x+5 through the point (-4, -5). - Find the equation of the line that is
*parallel*to \begin{align*}y=\frac{2}{3}x-7\end{align*}y=23x−7 through the point (3, 8).

**Know What?** The shortest distance between two points is a straight line. To the right are distances between cities in the Los Angeles area. What is the longest distance between Los Angeles and Orange? Which distance is the shortest?

## The Distance Formula

The distance between two points \begin{align*}(x_1, y_1)\end{align*}

**Example 1:** Find the distance between (4, -2) and (-10, 3).

**Solution:** Plug in (4, -2) for \begin{align*}(x_1, y_1)\end{align*} and (-10, 3) for \begin{align*}(x_2, y_2)\end{align*} and simplify.

\begin{align*}d& = \sqrt{(-10-4)^2+(3+2)^2}\\ & = \sqrt{(-14)^2 + (5)^2}\\ & = \sqrt{196+25}\\ & = \sqrt{221} \approx 14.87 \ units\end{align*}

**Example 2:** Find the distance between (-2, -3) and (3, 9).

**Solution:** Use the distance formula, plug in the points, and simplify.

\begin{align*}d & = \sqrt{(-2-3)^2 + (-3-9)^2}\\ & = \sqrt{(-5)^2 + (-12)^2}\\ & = \sqrt{25+144}\\ & = \sqrt{169} = 13 \ units\end{align*}

*Distances are always positive!*

## Shortest Distance between Vertical and Horizontal Lines

** All vertical lines are in the form \begin{align*}x = a\end{align*}, where a is the \begin{align*}x-\end{align*}intercept.** To find the distance between two vertical lines, count the squares between the two lines.

**Example 3:** Find the distance between \begin{align*}x = 3\end{align*} and \begin{align*}x = -5\end{align*}.

**Solution:** The two lines are 3 – (-5) units apart, or 8 units apart.

*You can use this method for horizontal lines as well. All horizontal lines are in the form \begin{align*}y = b\end{align*}, where \begin{align*}b\end{align*} is the \begin{align*}y-\end{align*} intercept.*

**Example 4:** Find the distance between \begin{align*}y = 5\end{align*} and \begin{align*}y = -8\end{align*}.

**Solution:** The two lines are 5 – (-8) units apart, or 13 units.

**Shortest Distance between Parallel Lines with \begin{align*}m = 1\end{align*} or -1**

The shortest distance between two parallel lines is the perpendicular line between them. There are infinitely many perpendicular lines between two parallel lines.

Notice that all of the pink segments are the same length.

**Example 5:** Find the distance between \begin{align*}y = x+6\end{align*} and \begin{align*}y=x-2\end{align*}.

**Solution:**

1. Find the perpendicular slope.

\begin{align*}m = 1\end{align*}, so \begin{align*}m_\perp=-1\end{align*}

2. Find the \begin{align*}y-\end{align*}intercept of the top line, \begin{align*}y=x+6\end{align*}. (0, 6)

3. Use the slope and count down 1 and to the right 1 until you hit \begin{align*}y=x-2\end{align*}.

**Always rise/run the same amount for \begin{align*}m = 1\end{align*} or -1.**

4. Use these two points in the distance formula to determine how far apart the lines are.

\begin{align*}d & = \sqrt{(0-4)^2 + (6-2)^2}\\ & = \sqrt{(-4)^2 + (4)^2}\\ & = \sqrt{16+16}\\ & = \sqrt{32} = 5.66 \ units\end{align*}

**Example 6:** Find the distance between \begin{align*}y=-x-1\end{align*} and \begin{align*}y=-x-3\end{align*}.

**Solution:**

1. Find the perpendicular slope.

\begin{align*}m = -1\end{align*}, so \begin{align*}m_\perp = 1\end{align*}

2. Find the \begin{align*}y-\end{align*}intercept of the top line, \begin{align*}y=-x-1\end{align*}. (0, -1)

3. Use the slope and count down 1 and to the *left* 1 until you hit \begin{align*}y=x-3\end{align*}.

4. Use these two points in the distance formula to determine how far apart the lines are.

\begin{align*}d & =\sqrt{(0-(-1))^2 + (-1-(-2))^2}\\ & = \sqrt{(1)^2+(1)^2}\\ & = \sqrt{1+1}\\ & = \sqrt{2} = 1.41 \ units\end{align*}

**Know What? Revisited** The shortest distance between Los Angeles and Orange is 26.3 miles along Highway 5. The longest distance is found by adding the distances along the110 and 405, or 41.8 miles.

## Review Questions

- Questions 1-10 are similar to Examples 1 and 2.
- Questions 11- are similar to Examples 3 and 4.
- Questions are similar to Examples 5 and 6.

Find the distance between each pair of points. Round your answer to the nearest hundredth.

- (4, 15) and (-2, -1)
- (-6, 1) and (9, -11)
- (0, 12) and (-3, 8)
- (-8, 19) and (3, 5)
- (3, -25) and (-10, -7)
- (-1, 2) and (8, -9)
- (5, -2) and (1, 3)
- (-30, 6) and (-23, 0)
- (2, -2) and (2, 5)
- (-9, -4) and (1, -1)

Use each graph below to determine how far apart each pair of parallel lines is.

Determine the shortest distance between the each pair of parallel lines. Round your answer to the nearest hundredth.

- \begin{align*}x = 5, x = 1\end{align*}
- \begin{align*}y = -6, y = 4\end{align*}
- \begin{align*}y = 3, y = 15\end{align*}
- \begin{align*}x = -10, x = -1\end{align*}
- \begin{align*}x = 8, x = 0\end{align*}
- \begin{align*}y = 7, y = -12\end{align*}
- What is the slope of the line \begin{align*}y=x+2\end{align*}?
- What is the slope of the line perpendicular to the line from #21?
- What is the \begin{align*}y-\end{align*}intercept of the line from #21?
- What is the equation of the line that is
*perpendicular*to \begin{align*}y=x+2\end{align*} through its \begin{align*}y-\end{align*}intercept? - Graph \begin{align*}y=x+2\end{align*} and the line you found in #24. Then, graph \begin{align*}y=x-4\end{align*}. Where does the perpendicular line cross \begin{align*}y=x-4\end{align*}?
- Using the answers from #23 and #25 and the distance formula, find the distance between \begin{align*}y=x+2\end{align*} and \begin{align*}y=x-4\end{align*}.

Find the distance between the parallel lines below.

- \begin{align*}y=x-3, \ y=x+11\end{align*}
- \begin{align*}y=-x+4, \ y=-x\end{align*}
- \begin{align*}y=-x-5, \ y = -x+1\end{align*}
- \begin{align*}y = x+12 , \ y=x-6\end{align*}

## Review Queue Answers

- \begin{align*}m = -4\end{align*}
- \begin{align*}y = \frac{1}{2}x-3\end{align*}
- \begin{align*}y = \frac{2}{3} x + 6\end{align*}