Sub topic 4
Horizontal and Vertical Lines
Prerequisites and the Basic Idea
Assume you can work with ordered pairs, fractions, negative numbers, and linear equations. You should also know that the slope of a line measures its change in \(y\) divided by its change in \(x\):
\[ m=\frac{y2-y1}{x2-x1} \]
Horizontal and vertical lines are special because one part of this ratio is always zero.
A horizontal line moves left or right but never rises or falls. Every point on it has the same \(y\)-coordinate. A vertical line moves up or down but never moves left or right. Every point on it has the same \(x\)-coordinate.
| Line type | Coordinate that stays constant | Equation | Slope |
|---|---|---|---|
| Horizontal | \(y\) | \(y=c\) | \(0\) |
| Vertical | \(x\) | \(x=c\) | Undefined |
Here, \(c\) is a constant number.
Horizontal Lines Have Slope Zero
Consider the points \((1,4)\) and \((6,4)\). Their \(y\)-coordinates are equal, so the change in \(y\) is zero:
\[ m=\frac{4-4}{6-1}=\frac{0}{5}=0 \]
The equation of the line is:
\[ y=4 \]
The line contains every point whose \(y\)-coordinate is 4, such as \((-3,4)\), \((0,4)\), and \((10,4)\). Its \(x\)-coordinate can change freely.
A horizontal line has no \(x\)-intercept unless it is the \(x\)-axis itself. To find an \(x\)-intercept, set \(y=0\). For \(y=4\), this is impossible. Its \(y\)-intercept is \((0,4)\).
Vertical Lines Have Undefined Slope
Consider \((3,1)\) and \((3,8)\). Their \(x\)-coordinates are equal, so the change in \(x\) is zero:
\[ m=\frac{8-1}{3-3}=\frac{7}{0} \]
Division by zero is undefined. Therefore, a vertical line has undefined slope, not zero slope.
The equation of this line is:
\[ x=3 \]
The line contains every point whose \(x\)-coordinate is 3, such as \((3,-2)\), \((3,0)\), and \((3,10)\). Its \(y\)-coordinate can change freely.
A vertical line has no \(y\)-intercept unless it is the \(y\)-axis itself. Its \(x\)-intercept is \((3,0)\).
def slope(p, q):
x1, y1 = p
x2, y2 = q
if x2 == x1:
return "undefined"
return (y2 - y1) / (x2 - x1)
print(slope((1, 4), (6, 4))) # 0.0
print(slope((3, 1), (3, 8))) # undefinedRecognizing Them on the GRE
A line is horizontal when two distinct points have the same \(y\)-coordinate. It is vertical when they have the same \(x\)-coordinate.
If an equation contains only \(y\), such as \(y=-2\), it represents a horizontal line. If it contains only \(x\), such as \(x=5\), it represents a vertical line.
Exercise
What are the slope and equation of the line through (−4, 7) and (2, 7)?
Show answer
The line is horizontal because both points have y-coordinate 7. Its equation is y = 7, and its slope is 0.