Equations of horizontal, vertical (and common diagonal) lines

Worksheet on the equations of horizontal and vertical lines
Worksheet on the equations of horizontal and vertical lines

Horizontal and vertical lines are all around us—think of the horizon stretching across the sky or the towering walls of a building. In math, understanding the equations of these lines helps us describe their positions on a graph. Horizontal lines have the same y-value across all points, while vertical lines share the same x-value. This makes them simple but powerful tools in geometry and algebra! Jump to the questions

Practise now

Provide equations for horizontal, vertical, and diagonal graphs as instructed.


Topic guide

What this worksheet practises

This worksheet focuses on identifying and writing the equations of perfectly horizontal and perfectly vertical lines. These equations look very different from standard y = mx + c equations because they lack one of the variables entirely.

Key method

The equation of these lines is determined by which axis they cross and the number they cross it at.

  • Vertical Lines: These lines go straight up and down. They cross the horizontal x-axis. Because every point on the line has the exact same x-coordinate, the equation is simply x = a number.
  • Horizontal Lines: These lines go straight across from left to right. They cross the vertical y-axis. Because every point on the line has the exact same y-coordinate, the equation is simply y = a number.

Worked example

What is the equation of the vertical line that passes through (4, 7)?

Step 1: Identify the line type. The question states it is a vertical line.

Step 2: Recall the rule. Vertical lines always have equations in the form x = a number.

Step 3: Look at the given coordinate (4, 7). The x-coordinate is 4.

Because the line is vertical, every single point on that line will have an x-coordinate of 4.

The equation is x = 4.

Common mistakes to avoid

The most common (and completely understandable) mistake is mixing them up. Because the x-axis is horizontal, students often assume the equation of a horizontal line must start with "x = ". It doesn't. A horizontal line runs parallel to the x-axis; it crosses the y-axis. Therefore, its equation is "y = ".

How to check your answer

If you are unsure, pick two random points on the line you've drawn or are looking at. If the line is horizontal (e.g. passing through (2, 5) and (8, 5)), notice which coordinate never changes. The y-coordinate is stuck at 5. Therefore, the equation is y = 5.