Sub topic 4
Horizontal and Vertical Lines
This chapter assumes you can plot points, use the slope formula (change in y divided by change in x), and solve simple one-variable equations. Horizontal and vertical lines are the two special cases of slope. They are easy to graph, but they break the usual slope-intercept form, and the GRE tests that.
Horizontal Lines: Zero Slope
A horizontal line is flat. Every point on it has the same y-coordinate. If that shared value is k, the equation is:
y = k
The x-coordinate can be anything. The points (-4, 3), (0, 3) and (6, 3) all lie on y = 3.
The slope formula shows why the slope is zero. Take two points on y = 3, for example (-4, 3) and (6, 3):
slope = (3 - 3) / (6 - (-4)) = 0 / 10 = 0
The rise is zero because the line never goes up or down. The run is not zero, so the division is valid and the answer is 0.
A horizontal line fits slope-intercept form directly: y = 0x + k. Its y-intercept is k.
Vertical Lines: Undefined Slope
A vertical line is straight up and down. Every point on it has the same x-coordinate. If that shared value is h, the equation is:
x = h
The y-coordinate can be anything. The points (2, 5), (2, 0) and (2, -3) all lie on x = 2.
Now compute the slope from (2, 5) and (2, -3):
slope = (-3 - 5) / (2 - 2) = -8 / 0
Division by zero has no value, so the slope is undefined. It is not zero, and it is not "infinite" in the GRE's vocabulary. Treat "undefined" as the correct term.
A vertical line cannot be written as y = mx + b, because there is no number m to use. The only form that works is x = h.
Comparing the Two Cases
| Feature | Horizontal line | Vertical line |
|---|---|---|
| Equation | y = k | x = h |
| What stays constant | y-coordinate | x-coordinate |
| Slope | 0 | Undefined |
| Rise and run | Rise is 0 | Run is 0 |
| y-intercept | (0, k) | None, unless the line is the y-axis (x = 0) |
| x-intercept | None, unless the line is the x-axis (y = 0) | (h, 0) |
| Fits y = mx + b | Yes, with m = 0 | No |
The axes are themselves special cases. The x-axis is the horizontal line y = 0, and the y-axis is the vertical line x = 0.
Checking the Rule in Code
The function below applies the same decision order as the diagram. It checks for equal x-values first, because that is the case where the slope formula would divide by zero.
def classify_line(p, q):
(x1, y1), (x2, y2) = p, q
if (x1, y1) == (x2, y2):
return "same point: no unique line"
if x1 == x2:
return f"vertical line x = {x1}, slope undefined"
if y1 == y2:
return f"horizontal line y = {y1}, slope 0"
return f"slanted line, slope {(y2 - y1) / (x2 - x1)}"
print(classify_line((2, 5), (2, -3)))
print(classify_line((-4, 3), (6, 3)))
print(classify_line((1, 2), (3, 8)))This prints:
vertical line x = 2, slope undefined
horizontal line y = 3, slope 0
slanted line, slope 3.0The first check matters. If the two points are identical, infinitely many lines pass through them, so no single equation is determined.
Reading Equations That Look Different
The GRE rarely writes y = 3 plainly. Watch for disguised versions:
- 2y = 10 simplifies to y = 5, a horizontal line.
- 3x + 6 = 0 simplifies to x = -2, a vertical line.
- y - 4 = 0 is y = 4, a horizontal line.
- In the general form ax + by = c, a horizontal line has a = 0 (so by = c), and a vertical line has b = 0 (so ax = c).
A useful test: if an equation has only one variable, the line is horizontal or vertical. The variable that appears is the coordinate that is held fixed. An equation with only y fixes y, so the line is horizontal. An equation with only x fixes x, so the line is vertical.
Intercepts of Horizontal and Vertical Lines
Intercepts follow from the equation.
- y = 3 crosses the y-axis at (0, 3). It never reaches y = 0, so it has no x-intercept.
- x = 2 crosses the x-axis at (2, 0). It never reaches x = 0, so it has no y-intercept.
A line can lack an intercept only if it is parallel to an axis (and is not that axis). A slanted line, even a nearly flat one, always crosses both axes. The exception is a slanted line through the origin, where both intercepts are the same point (0, 0).
Distances and Shapes
Horizontal and vertical lines make distances simple, and the GRE uses this.
- The distance from a point (a, b) to the horizontal line y = k is |b - k|.
- The distance from a point (a, b) to the vertical line x = h is |a - h|.
- Two points on the same horizontal line are |x2 - x1| apart. Two points on the same vertical line are |y2 - y1| apart.
No square root is needed in these cases, because the distance formula collapses to a single difference.
Worked example: a rectangle from four lines
The lines x = -1, x = 4, y = 2 and y = -3 bound a rectangle. Find its area.
- The vertical sides are 4 - (-1) = 5 units apart, so the width is 5.
- The horizontal sides are 2 - (-3) = 5 units apart, so the height is 5.
- The area is 5 × 5 = 25. The figure is a square.
The common mistake is computing 4 - 1 or 2 - 3 and dropping the negative sign of a coordinate. Subtract carefully, with parentheses around negative values.
Worked example: perpendicular through a point
Find the line through (3, -2) that is perpendicular to y = 5.
The line y = 5 is horizontal, so a perpendicular line must be vertical. A vertical line through (3, -2) keeps the x-coordinate 3, so the answer is x = 3.
Parallel and Perpendicular Cases
For slanted lines, parallel lines share a slope, and perpendicular lines have slopes that are negative reciprocals. That second rule fails for horizontal and vertical lines.
- A horizontal line has slope 0. Its "negative reciprocal" would be -1/0, which is undefined. That fits, because the perpendicular line is vertical, with undefined slope.
- You cannot compute this with the product-equals-minus-one test, because one slope is undefined. Use the geometric fact instead: every horizontal line is perpendicular to every vertical line.
- Two horizontal lines are parallel, for example y = 1 and y = 7. Two vertical lines are parallel, for example x = -2 and x = 9.
Common Errors
- Confusing zero with undefined. Horizontal means slope 0. Vertical means slope undefined. A reliable memory aid: the equation y = k has y alone, and a flat line has "nothing" for rise.
- Swapping x = h and y = k. The line y = 3 is horizontal, not vertical, even though the number 3 sits on the x-axis side in your head. Check by plotting one point: y = 3 contains (0, 3), which is above the origin on the y-axis, and the line runs sideways through it.
- Saying a vertical line has "no slope." On the GRE, "no slope" is ambiguous. Zero slope and undefined slope are different facts, so state which one you mean.
- Forcing y = mx + b. If you try to convert x = 2 into slope-intercept form, you will divide by zero. Leave it as x = 2.
- Assuming every line has both intercepts. Horizontal and vertical lines each miss one axis.
Quick Reference
- Horizontal: y = k, slope 0, y-intercept k, parallel to the x-axis.
- Vertical: x = h, slope undefined, x-intercept h, parallel to the y-axis.
- Horizontal and vertical lines always meet at a right angle, at the point (h, k).
- The intersection of x = h and y = k is the single point (h, k), which is a quick way to find a corner of a rectangle.
Exercise
A line passes through (-3, 4) and (-3, 9). (a) What is its equation? (b) What is its slope? (c) What is the distance between the two points?
Show answer
(a) Both points have x = -3, so the line is vertical: x = -3. (b) The slope is undefined, because the run is -3 - (-3) = 0 and the slope formula divides by zero. (c) The points share an x-coordinate, so the distance is |9 - 4| = 5.
Exercise
The lines y = -2, y = 6, x = 1 and x = 10 form a rectangle. What is its perimeter, and what are its four corner points?
Show answer
The width is 10 - 1 = 9 and the height is 6 - (-2) = 8. The perimeter is 2(9 + 8) = 34. The corners are the intersections of each vertical line with each horizontal line: (1, -2), (10, -2), (1, 6) and (10, 6).
Exercise
Line A is 3y - 12 = 0. Line B passes through (5, 1) and (5, 8). Are the lines parallel, perpendicular, or neither? Explain.
Show answer
Line A simplifies to y = 4, a horizontal line. Line B has equal x-coordinates, so it is the vertical line x = 5. A horizontal line and a vertical line are perpendicular. They meet at (5, 4).