Skip to ContentGo to accessibility pageKeyboard shortcuts menu
OpenStax Logo
Algebra 1

1.14.5 Writing an Equation of a Line Parallel or Perpendicular to an Axis

Algebra 11.14.5 Writing an Equation of a Line Parallel or Perpendicular to an Axis

Search for key terms or text.

Activity

The line  x = 5 x = 5 and the point ( 3 , 2 ) ( 3 , 2 ) are shown on the graph.

A graph with a vertical arrowed line passing through x = 5, and a light blue point at (3, -2) on a labeled x and y axis grid. ranging from -8 to 8.

Work with a partner to complete the tasks:

1.

Identify the slope of the original line, l l .

Use the graphing tool or technology outside the course.

2.

Graph line m m through the point (3, -2) and parallel to line l l using the Desmos tool.

Then,

3.

Identify the slope of the new line, m m .

4.

Write the equation of the new line, m m .

Use the graphing tool or technology outside the course.

5.

Graph line n n through the point ( 3 , 2 ) ( 3 , 2 ) and perpendicular to line l l using the Desmos tool.

Then,

6.

Identify the slope of the new line, n n .

7.

Write the equation of the new line, n n .

The original line l l and the line m m that you created are both parallel to the y y -axis and perpendicular to the x x -axis. It follows, then, that line n is parallel to the x x -axis and perpendicular to the y y -axis.

8.

Write the equation of a line that is parallel to the y y -axis and passing through ( 2 , 5 ) ( 2 , 5 ) .

9.

Write the equation of a line that is perpendicular to the y y -axis and passing through ( 1 , 5 ) ( 1 , 5 ) .

10.

Write the equation of a line parallel to the x x -axis and passing through ( 3 , 4 ) ( 3 , 4 ) .

11.

How does the line described as “parallel to the x x -axis and passing through ( 3 , 4 ) ( 3 , 4 ) ” relate to the y y -axis? Will it always, sometimes, or never be perpendicular to it?

Self Check

Which is the equation that is perpendicular to the line  x = 1 that contains the point ( 5 , 2 ) .
  1. y = 2
  2. y = 1
  3. x = 5
  4. y = 2

Additional Resources

Find Equations of Lines Perpendicular to an Axis

Lines that are horizontal or vertical are special for two reasons. First, their equations have just one variable.

  • Horizontal line y = b y = b ; because all the y y -coordinates are the same and the slope equals zero.
  • Vertical line x = a x = a ; because all the x x -coordinates are the same and the slope is undefined.

Second, they have a special relationship with the x- and y-axes because they are either parallel or perpendicular to them.

Examine the line that passes through ( 0 , 4 ) ( 0 , 4 ) and ( 3 , 4 ) ( 3 , 4 ) .

A graph with a horizontal line segment from (0, 4) to (3, 4) on the xy-plane. Arrows at both ends indicate the segment extends beyond these points. The grid is labeled from -1 to 5 on x and -1 to 7 on y.

What is the rise? The rise is 0.

What is the run? The run is 3.

What is the slope? m = rise run = 0 3 = 0 m = rise run = 0 3 = 0

So, the horizontal line passing through ( 0 , 4 ) ( 0 , 4 ) and ( 3 , 4 ) ( 3 , 4 ) has a slope of 0. For all of the points on this line, the y y -values will always equal 4. So, the equation is y = 4 y = 4 .

Also notice that it is parallel to the x x -axis and perpendicular to the y y -axis.

Now consider the vertical line passing through ( 3 , 2 ) ( 3 , 2 ) and ( 3 , 0 ) ( 3 , 0 ) .

A graph with a vertical line passing through x=3, intersecting points (3,0) and (3,2). The line extends from y = -5 to y = 5. The x- and y-axes range from -5 to 5.

What is the rise? The rise is 2.

What is the run? The run is 0.

What is the slope? m = rise run = 2 0 m = rise run = 2 0 (undefined)

So, the vertical line passing through ( 3 , 2 ) ( 3 , 2 ) and ( 3 , 0 ) ( 3 , 0 ) has an undefined slope. And, for all of the points on this line, the x x -values will always equal 3. So, the equation is x = 3 x = 3 .

Also notice that it is parallel to the y y -axis and perpendicular to the x x -axis.

Example 1

Find the equation of the line parallel to the x x -axis and passing through ( 8 , 1 ) ( 8 , 1 ) .

Step 1 - Identify the point.

( 8 , 1 ) ( 8 , 1 )

Step 2 - Identify the slope of the line.

Since the line is parallel to the x x -axis, the line is horizontal. This means the slope of the line is 0.

m = 0 m = 0

Step 3 - Substitute the values into an equation.

From here, you may know the equation, but if you don’t, then we can use the point-slope equation.

y y 1 = m ( x x 1 ) y y 1 = m ( x x 1 )

y 1 = 0 ( x 8 ) y 1 = 0 ( x 8 )

Step 4 - Simplify.

y 1 = 0 y 1 = 0

y = 1 y = 1

Thus, the equation of the line parallel to the x x -axis and passing through ( 8 , 1 ) ( 8 , 1 ) is y = 1 y = 1 .

Example 2

Find the equation of the line perpendicular to the x x -axis and passing through ( 8 , 1 ) ( 8 , 1 ) .

Step 1 - Identify the point.

( 8 , 1 ) ( 8 , 1 )

Step 2 - Identify the slope of the line.

Since the line is perpendicular to the x x -axis, the line is vertical. This means the slope of the line is undefined!

m = undefined m = undefined

Step 3 - Substitute the values into an equation.

Since the slope is undefined, we cannot use the point-slope equation. But, we know that if ( 8 , 1 ) ( 8 , 1 ) is on the line, then another point vertically above this point is ( 8 , 2 ) ( 8 , 2 ) . Another point vertically below this point is ( 8 , 0 ) ( 8 , 0 ) . On a vertical line, the x-values do not change.

So, x = x 1 x = x 1

x = 8 x = 8

Example 3

Find an equation of a line perpendicular to x = 5 x = 5 that contains the point ( 3 , 2 ) ( 3 , 2 ) . Write the equation in slope-intercept form.

Again, since we know one point, the point-slope option seems more promising than the slope-intercept option. We need the slope to use this form, and we know the new line will be perpendicular to x = 5 x = 5 . This line is vertical, so its perpendicular will be horizontal. This tells us the m = 0 m = 0 .

Step 1 - Identify the point.

( 3 , 2 ) ( 3 , 2 )

Step 2 - Identify the slope of the perpendicular line.

m = 0 m = 0

Step 3 - Substitute the values into an equation.

y y 1 = m ( x x 1 ) y ( 2 ) = 0 ( x 3 ) y y 1 = m ( x x 1 ) y ( 2 ) = 0 ( x 3 )

Step 4 - Simplify

y + 2 = 0 y = 2 y + 2 = 0 y = 2

Example 4

Find an equation of a line that is perpendicular to  y = 4 y = 4 that contains the point ( 2 , 3 ) ( 2 , 3 ) . Write the equation in slope-intercept form.

The line y = 4 y = 4 is a horizontal line. Any line perpendicular to it must be vertical, in the form x = a x = a . Since the perpendicular line is vertical and passes through ( 2 , 3 ) ( 2 , 3 ) , every point on it has an x x -coordinate of 2. The equation of the perpendicular line is x = 2 x = 2 .

Try it

Try It: Find Equations of Lines Perpendicular to an Axis

Find an equation of a line that is perpendicular to  y = 3 y = 3 that contains the point ( 3 , 5 ) ( 3 , 5 ) .

Citation/Attribution

This book may not be used in the training of large language models or otherwise be ingested into large language models or generative AI offerings without OpenStax's permission.

Want to cite, share, or modify this book? This book uses the Creative Commons Attribution-NonCommercial-ShareAlike License and you must attribute OpenStax.

Attribution information
  • If you are redistributing all or part of this book in a print format, then you must include on every physical page the following attribution:

    Access for free at https://openstax.org/books/algebra-1/pages/about-this-course

  • If you are redistributing all or part of this book in a digital format, then you must include on every digital page view the following attribution:

    Access for free at https://openstax.org/books/algebra-1/pages/about-this-course

Citation information

© May 21, 2025 OpenStax. Textbook content produced by OpenStax is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike License . The OpenStax name, OpenStax logo, OpenStax book covers, OpenStax CNX name, and OpenStax CNX logo are not subject to the Creative Commons license and may not be reproduced without the prior and express written consent of Rice University.