Skip to ContentGo to accessibility page
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

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

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

Activity

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

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,−23,−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 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 ) .

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 ) .

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 xx-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

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
Reuse and redistribution of this content in digital or print format:
  • 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 prior written permission.
  • This book uses the Creative Commons Attribution-NonCommercial-ShareAlike License, which means that you can reuse and modify the material only for noncommercial purposes, must attribute OpenStax, and must distribute any derivative works under the same license.
  • Any commercial printing of this textbook, including using a local or custom printer, must be approved by OpenStax, and proper citation provided.
  • OpenStax-copyrighted images, activities, assessments, and similar components of this book are subject to the same licensing – CC-BY-NC-SA. They can be used for noncommercial purposes with attribution. Commercial use requires permission.
  • Permission requests: Anyone who intends to incorporate this content (including text, images, and other components) into large language models, use it in AI offerings, use it commercially (including in print), and/or has questions about another use case is welcome to complete our reuse request form.
Attribution information
  • If you are redistributing all or part of this book in a noncommercial 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 noncommercial digital format, then for every page that includes OpenStax content, you must license the derivative work under the same CC-BY-NC-SA license as the original, and 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

The information below includes the information needed to generate citations in most major styles (APA, MLA, etc.); you must reformat and organize the information as needed to fit the requirements of the style. Use the information below to generate a citation. We recommend using a citation tool such as this one.

© Apr 23, 2026 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, and Rice University name, and Rice University logo trademarks, or wordmarks are not subject to the Creative Commons license and may not be reproduced without the prior and express written consent of Rice University.