Sub topic 10
Horizontal and Vertical Lines as Special Cases
Prerequisites: You should know how to plot points, calculate slope as rise over run, use slope-intercept form, and solve simple equations with fractions and negative numbers.
Most nonvertical lines have a defined slope. Two special cases need separate treatment:
- A horizontal line has slope 0.
- A vertical line has an undefined slope.
These lines still fit standard form, but a vertical line cannot be written in point-slope form.
Horizontal lines
A horizontal line does not rise or fall as x changes. Every point on the line has the same y-coordinate. For example, the line through \((4, 7)\) is
\[ y=7 \]
Its slope is
\[ m=\frac{7-7}{x2-x1}=0. \]
Using point-slope form with the point \((4,7)\):
\[ y-7=0(x-4). \]
This simplifies to \(y=7\). In standard form, the same equation is
\[ 0x+y=7. \]
The x-coordinate may vary, but the y-coordinate must remain 7.
Vertical lines
A vertical line does not move left or right as y changes. Every point on the line has the same x-coordinate. For example, the line through \((4,7)\) is
\[ x=4. \]
To calculate its slope, we would divide by zero:
\[ m=\frac{y2-y1}{x2-x1} =\frac{y2-y1}{4-4}. \]
Division by zero is undefined, so the line has no defined slope.
Point-slope form requires a numerical slope:
\[ y-y1=m(x-x1). \]
Because a vertical line has no defined slope, it has no point-slope form. Its direct equation is \(x=x_1\). In standard form, write it as
\[ 1x+0y=x_1. \]
For \(x=4\), this is \(x+0y=4\).
Comparing the forms
| Line type | Slope | Point-slope form | Standard form |
|---|---|---|---|
| Horizontal through \((x_1,y_1)\) | \(0\) | \(y-y_1=0(x-x_1)\) | \(0x+y=y_1\) |
| Vertical through \((x_1,y_1)\) | Undefined | Not available | \(x+0y=x_1\) |
A useful test is to inspect which coordinate stays constant. If y stays constant, the line is horizontal. If x stays constant, the line is vertical.
Writing related parallel and perpendicular lines
Parallel lines have the same direction. A line parallel to a horizontal line is also horizontal. A line parallel to a vertical line is also vertical.
Perpendicular lines meet at a right angle. A horizontal line is perpendicular to a vertical line. This is the special-case version of the negative-reciprocal slope rule, which cannot be applied directly when one slope is undefined.
For example:
- Through \((2,5)\), the horizontal line is \(y=5\).
- Through \((2,5)\), the vertical line is \(x=2\).
- These two lines are perpendicular.
def special_line(point, direction):
x, y = point
if direction == "horizontal":
return f"y = {y}"
if direction == "vertical":
return f"x = {x}"
raise ValueError("direction must be horizontal or vertical")
print(special_line((2, 5), "horizontal")) # y = 5
print(special_line((2, 5), "vertical")) # x = 2Exercise
Write the equation in point-slope form and standard form for the horizontal line through \((-3, 6)\).
Show answer
Point-slope form: \(y-6=0(x+3)\). Standard form: \(0x+y=6\), usually written \(y=6\).
Exercise
Write the standard-form equation for the vertical line through \((8,-2)\). Does it have a point-slope form?
Show answer
The standard form is \(x+0y=8\), usually written \(x=8\). It has no point-slope form because its slope is undefined.