# Vertical and Horizontal Lines

There are two types of lines that don't easily fit into the "slope and intercept" view that we've seen throughout the previous sections in the class: vertical lines and horizonal lines. We've summarized some basic facts about these lines in the two tables below.

**Points on the Line** All of the points on the line will have the same *x* value so, if you're given two points like (-2, -5) and (-2, 6), you can tell the line is vertical because their *x*-coordinates are the same.

**The Equation** The equation of a vertical line has an *x* variable but no *y* variable, e.g. *x* = -2.

**Slopes** Pick any two points on the line and they'll have the same *x*-coordinate. This means the denominator of the slope formula will be 0 so the line's slope is undefined.

**Points on the Line** All of the points on the line will have the same *y* value so, if you're given two points like (3, -5) and (-2, -5), you can tell the line is vertical because their *y*-coordinates are the same.

**The Equation** The equation of a horizontal line has a *y* variable but no *x* variable, e.g. *y* = -5.

**Slopes** Pick any two points on the line and they'll have the same *y*-coordinate. This means the numerator of the slope formula will be 0 so the line's slope must be 0.

# Example 1

**Find the equation of the line through the points (2, 7) and (-4, 7).**

The first thing we need to do is find the line's slope.

$$m=\frac{7-7}{2-(-4)}=\frac{0}{6}=0$$Now we can substitute that into the slope-intercept form of the equation and we're half way there.

$$y=0x+b=b$$Now, I'll take the second point (it doesn't matter which you chose) and substitute it's *y* value into our partial equation.

7 = *b*

If we substitute that into our "half equation", we get the equation of the line:

*y* = 7

# Example 2

**Find the equation of the line through the points (4, -1) and (3, -1).**

You can start this process the same way as example one but, if you're a little observant, you can make the process a little faster. If you look closely at the points, you'll see that they both have the same *y*-coordinate. Since the line is vertical and we know that the equation of a vertical line looks like *y* = (a number) we can jump right to our equation:

*y* = -1

I got the -1 from the *y*-coordinate of the points.

# Example 3

**Find the equation of the line through the points (3, 1) and (3, -4).**

At this point, our two formulas, point-slope and slope-intercept, are going to fail us. Neither of them is any use when the slope is undefined. At this point, you have to just realize that the line is vertical so the equation will be:

*x* = 3

Where the 3 is the common *x*-coordinate of the two points.