Algebra 1Linear FunctionsF-IF.C.7a

Horizontal and Vertical Lines

y = k is flat with slope 0; x = h is vertical with no slope.

Not started Jump to practice

Two kinds of lines look too simple to need a lesson, yet they trip people up: flat ones and straight-up ones. They are the special cases of standard form $Ax + By = C$ where $A$ or $B$ is $0$.

Why it works

On a horizontal line every point has the same height. Through $(2, 3)$, that height is $3$, so every point satisfies $y = 3$, whatever $x$ is. The rise between any two points is $0$, so the slope is $\frac{0}{\text{run}} = 0$. On a vertical line every point has the same $x$: through $(2, 3)$ it is $x = 2$. Now the run is $0$, and $\frac{\text{rise}}{0}$ is not a number: a vertical line has no slope (its slope is undefined). It is also not a function, since one input, $x = 2$, has many outputs.
The vertical line $x = 2$ and the horizontal line $y = 3$ cross at $(2, 3)$. Drag the test point along each line and watch which coordinate stays fixed.
The two special lines.
LineEquationSlopeEvery point looks like
horizontal through $(a, b)$$y = b$$0$$(\text{anything}, b)$
vertical through $(a, b)$$x = a$undefined$(a, \text{anything})$

Key idea

$y = k$ is horizontal with slope $0$. $x = h$ is vertical with no (undefined) slope. Name the coordinate that never changes.

Worked examples

Worked example: Through two points

Write the equation of the line through $(-4, 1)$ and $(-4, 6)$.
  1. Both points have $x = -4$, so the run is $0$ and the line is vertical.
  2. Every point on it has $x = -4$.

Answer: $x = -4$

Worked example: Perpendicular to a horizontal line

Write the line through $(5, -2)$ perpendicular to $y = 7$.
  1. $y = 7$ is horizontal, so a perpendicular line is vertical.
  2. The vertical line through $(5, -2)$ is $x = 5$.

Answer: $x = 5$

Common mistake

Graphing $x = 3$ as a horizontal line, and saying a vertical line has slope $0$. The equation $x = 3$ fixes $x$, so the points are $(3, 0)$, $(3, 1)$, $(3, -2)$: they stack vertically. Its run is $0$, so the slope is undefined; slope $0$ belongs to horizontal lines.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 1 XP.

Loading practice…

Builds on

Leads to

This is one of the top rungs of Algebra 1.

Sources and further reading

  • OpenStax, Elementary Algebra 2e, section 4.2 Graph Linear Equations in Two Variables (vertical and horizontal lines)
  • Common Core State Standards for Mathematics, F-IF.C.7a
@teddyrookbook GitHub