Math

Slope of Horizontal and Vertical Lines

Horizontal lines have a slope of zero because they have no vertical rise — every point on the line shares the same y-value. Vertical lines have an undefined slope because any attempt to calculate rise over run produces division by zero, as every point shares the same x-value. These two special cases are covered in Chapter 4 of OpenStax Elementary Algebra 2E and are essential for writing equations of lines: horizontal lines are written as y = k (a constant), and vertical lines as x = k. Understanding these cases prevents common errors when graphing and writing linear equations.

Key Concepts

Property The slope of a horizontal line, $y = b$, is 0. The slope of a vertical line, $x = a$, is undefined.

Examples The line $y = 5$ is a horizontal line. Its slope is 0. The line $x = 3$ is a vertical line. Its slope is undefined. A line passing through the points $(2, 6)$ and $(9, 6)$ has a rise of $6 6 = 0$, so its slope is $m = \frac{0}{7} = 0$.

Explanation A horizontal line is perfectly flat, so its 'rise' is always zero, making the slope 0. A vertical line is infinitely steep; its 'run' is zero, and since we can't divide by zero, its slope is undefined.

Common Questions

What is the slope of a horizontal line?

The slope of a horizontal line is 0. Because the line never rises or falls, the rise is always 0, and 0 divided by any run equals 0.

What is the slope of a vertical line?

The slope of a vertical line is undefined. Because the run is always 0, you would be dividing by zero when computing rise/run, which is undefined.

Why is dividing by zero undefined?

Division by zero has no meaningful answer because there is no number that, when multiplied by zero, gives a nonzero result. That is why vertical lines have undefined, not infinite, slope.

How do you write the equation of a horizontal line?

A horizontal line has the equation y = k, where k is the constant y-value. For example, a line passing through (0, 4) and (3, 4) has the equation y = 4.

How do you write the equation of a vertical line?

A vertical line has the equation x = k, where k is the constant x-value. For example, a line passing through (2, 0) and (2, 5) has the equation x = 2.

When do students learn about slope of horizontal and vertical lines?

This topic is taught in algebra 1, typically in 8th or 9th grade, and is covered in Chapter 4 of OpenStax Elementary Algebra 2E.

What is the difference between zero slope and undefined slope?

Zero slope means the line is perfectly flat (horizontal). Undefined slope means the line is perfectly vertical. A common mistake is calling vertical slope infinite — the correct term is undefined.