Equation of a Line Parallel to the Y-Axis: Definition Formula and Examples

#Equation of a Line Parallel to the Y-axis
TL;DR
The equation of a line parallel to the y-axis is x=ax = a, where aa is its fixed x-coordinate. Every point shares that x-coordinate, and its slope is undefined, not zero.
Ashish Chauhan·reviewed byShikha SharmaLast updated on December 2, 202613 min read

Key Points

  • Every point on the line has the same x-coordinate, aa; yy can be anything.
  • You need only the x-coordinate of one point to write the equation.
  • The slope is undefined: the run is 0, and dividing by 0 has no answer.
  • It has no y=mx+cy = mx + c form, but fits Ax+By+C=0Ax + By + C = 0 with B=0B = 0.
  • x=a1x = a_1 and x=a2x = a_2 are ∣a1−a2∣|a_1 - a_2| units apart.

What Keeps a Skyscraper's Core Perfectly Straight Up?

A plumb line dropped from the top of a skyscraper never leans to the left or right. Builders hang a weight on a string because gravity pulls it straight down into a true vertical. Drawn on a grid, that string is a line parallel to the y-axis.

  • The height changes all the way down the string.
  • The across-position never changes, so one number, the x-coordinate, captures the whole line.

That is the equation of a line parallel to the y-axis:

x=ax = a

A string 3 units right of the y-axis is the line x=3x = 3, top to bottom. It has no tilt and, as it turns out, no slope at all.

the equation of a line parallel to the y-axis is x = a, where a is its fixed x-coordinate
Three lines parallel to the y-axis: x = 3 three units to the right, x = 0 which is the y-axis itself, and x = −2.5 two and a half units to the left, with arrows marking each distance from the y-axis.

What Is the Equation of a Line Parallel to the Y-Axis?

It is x=ax = a, where aa is a constant. The line holds every point whose x-coordinate is aa, such as (a,−4)(a, -4), (a,0)(a, 0) and (a,9.5)(a, 9.5).

Value of a Position Example
a>0a > 0 right of the y-axis x=3x = 3
a=0a = 0 on the y-axis x=0x = 0
a<0a < 0 left of the y-axis x=−2.5x = -2.5

Why there is no y in the equation

An equation lists the conditions a point must meet. Here the only condition is x=ax = a; any height will do. A missing variable means that coordinate is free.

How to draw x = a

  1. Find aa.
  2. Mark (a,0)(a, 0) on the x-axis.
  3. Mark a point straight above it, such as (a,3)(a, 3).
  4. Join them and extend the line up and down.

Why Is the Slope of a Line Parallel to the Y-Axis Undefined?

Slope is rise over run, and here the run is always zero. For two points (a,y1)(a, y_1) and (a,y2)(a, y_2):

m=y2−y1a−a=y2−y10m = \frac{y_2 - y_1}{a - a} = \frac{y_2 - y_1}{0}
  • 62=3\frac{6}{2} = 3 because 3×2=63 \times 2 = 6.
  • So 50\frac{5}{0} would need a number that gives 5 when multiplied by 0. None exists.
  • The slope is undefined: not zero, not large, not a number.

Zero slope means flat; an undefined slope means upright. Mixing them up is the most common error.

Why "infinite slope" is loose talk

Slope is the tangent of the angle the line makes with the x-axis. Watch it as the line steepens:

  • at 45°45°, slope tan⁡45°=1\tan 45° = 1
  • at about 71.6°71.6°, slope 33
  • at about 84.3°84.3°, slope 1010
  • at 90°90°, no value at all
as a line steepens its slope grows without limit and a vertical line has no slope
Lines from one point at 45 degrees with slope 1, 71.6 degrees with slope 3 and 84.3 degrees with slope 10, and a vertical line at 90 degrees marked undefined, beside a panel listing tan 45° = 1, tan 71.6° = 3, tan 84.3° = 10 and tan 90° has no value.
  • Just past vertical, at 95°95°, the slope is tan⁡95°≈−11.4\tan 95° \approx -11.4.
  • From one side the slope races up; from the other it races down. There is no single number, so "infinite" hides the picture.

How Do You Find the Equation of a Line Parallel to the Y-Axis?

You need one number: the x-coordinate of any point on the line. Through (a,b)(a, b), the line is x=ax = a, and bb is ignored.

  • If x changed, the line would tilt. So the equation locks x and says nothing about y.

Spotting one from two points

Compare the x-coordinates first. (4,−1)(4, -1) and (4,6)(4, 6) share x=4x = 4, so the line is x=4x = 4. The slope formula would divide by zero, which says the same thing.

Why x = a cannot be written as y = mx + c

  • Slope-intercept form needs a slope, and this line has none.
  • It also needs a y-intercept, and x=5x = 5 never crosses the y-axis.
  • The general form Ax+By+C=0Ax + By + C = 0 has room. Choose B=0B = 0:
Ax+C=0Ax + C = 0
x=−CAx = -\frac{C}{A}

For example, 3x−12=03x - 12 = 0 is the line x=4x = 4. Any linear equation with no yy term is one of these lines.

What Is the Equation of the Y-Axis Itself?

Every point on the y-axis, like (0,5)(0, 5) or (0,−7)(0, -7), has x-coordinate 0, so its equation is x=0x = 0.

What Are the Properties of a Line Parallel to the Y-Axis?

Locking x to a constant gives this line its own set of properties.

  • Equation x=ax = a: one constant describes the whole line.
  • Same x for every point: y can be any real value.
  • Undefined slope: the run is 0.
  • Not a function of x: it fails the vertical line test (next section).
  • Perpendicular to the x-axis, meeting it at (a,0)(a, 0).
  • Never crosses the y-axis unless a=0a = 0.
  • Distance from the y-axis: ∣a∣|a|, right if a>0a > 0, left if a<0a < 0.

Distances and meeting points

Two lines x=a1x = a_1 and x=a2x = a_2 never meet, and the gap is the same at every height:

distance=∣a1−a2∣\text{distance} = |a_1 - a_2|
  • The halfway line is x=a1+a22x = \frac{a_1 + a_2}{2}.
  • To meet a slanted line, put x=ax = a into it. For x=3x = 3 and y=2x−1y = 2x - 1: y=5y = 5, so (3,5)(3, 5).
  • A horizontal line y=by = b meets it at (a,b)(a, b), at a right angle.

Why x = a Is Not a Function of x

A function gives each input one output, but x=2x = 2 pairs the input 2 with every y. The points (2,−2)(2, -2), (2,1)(2, 1) and (2,3)(2, 3) all lie on it. It fails the vertical line test.

a line parallel to the y-axis fails the vertical line test
The vertical line x = 2 with the points (2, 3), (2, 1) and (2, −2) marked: the one input 2 gives outputs −2, 1, 3 and more, so x = 2 is not a function of x, though it is a function of y.

Turn it around: with y as the input, the output is always 2. As a function of yy, x=2x = 2 is a constant function.

Try It Yourself

In the tool, drag both blue handles to the same x, such as (2,−3)(2, -3) and (2,4)(2, 4): m1m_1 reads "undefined". Put the orange handles at (−4,1)(-4, 1) and (4,1)(4, 1) and the verdict says perpendicular. Nudge one blue handle sideways and an enormous slope appears.

Examples of the Equation of a Line Parallel to the Y-Axis

Six short examples, from reading aa off a point to a pair of parallel lines.

Example 1

Write the line parallel to the y-axis through (4, 5).

  1. The x-coordinate is 4; the y-value is ignored.

Answer: x=4x = 4.

Example 2

Find the line through (−2, 7) parallel to the y-axis.

  1. y=−2y = -2 is tempting, but (−2,7)(-2, 7) has y=7y = 7, so it misses the point.
  2. A line parallel to the y-axis fixes x, and the point's x-coordinate is −2-2.

Answer: x=−2x = -2.

the line parallel to the y-axis through a point keeps its x-coordinate
The green vertical line x = −2 passing through (−2, 7), and the dashed orange horizontal line y = −2 that misses the point.

Example 3

Find the line parallel to the y-axis and 6 units to its left.

  1. Left means a negative x-value.

Answer: x=−6x = -6.

Example 4

A line parallel to the y-axis has the same x-intercept as 3x + 5y − 15 = 0. Find it.

  1. Set y=0y = 0: 3x−15=03x - 15 = 0, so x=5x = 5.

Answer: x=5x = 5.

Example 5

Find the line parallel to the y-axis through the point where 2x + y = 7 and x − y = 2 meet.

  1. Add the equations: 3x=93x = 9, so x=3x = 3.
  2. Then y=3−2=1y = 3 - 2 = 1; they meet at (3,1)(3, 1).

Answer: x=3x = 3.

a line parallel to the y-axis through the intersection of two lines
The lines 2x + y = 7 and x − y = 2 crossing at (3, 1), with the green vertical line x = 3 drawn through that point.

Example 6

How far apart are x = −3 and x = 4, and which line lies midway?

  1. Distance: ∣4−(−3)∣=7|4 - (-3)| = 7 units.
  2. Midway: x=−3+42=0.5x = \frac{-3 + 4}{2} = 0.5.

Answer: 7 units apart; x=0.5x = 0.5 is halfway.

two lines parallel to the y-axis are |a1 − a2| units apart
The lines x = −3 and x = 4 with a green double arrow between them showing |4 − (−3)| = 7, and the dashed line x = 0.5 midway.

Where Do Students Trip Up on Lines Parallel to the Y-Axis?

Mistake 1: Writing y = a instead of x = a

Where it slips in: The question says "y-axis", or the familiar "y=y =" habit takes over.

Don't do this: Write y=4y = 4 for the line through (4,5)(4, 5).

The correct way: Along the y-direction, y varies and x stays fixed. Write x=4x = 4.

Mistake 2: Calling the slope zero

Where it slips in: Mixing up which axis-parallel line has slope 0.

Don't do this: Say the slope of x=5x = 5 is 0.

The correct way: From (5,1)(5, 1) to (5,4)(5, 4): rise 3, run 0, and 30\frac{3}{0} has no value. Zero slope belongs to flat lines.

Mistake 3: Forcing x = a into y = mx + c

Where it slips in: Treating y=mx+cy = mx + c as "the" equation of a line and meeting x=5x = 5.

Don't do this: Invent a huge mm, or write y=5y = 5.

The correct way: Say it has no slope-intercept form, and write x=5x = 5, the general form x−5=0x - 5 = 0.

Mistake 4: Giving one answer to "4 units from the y-axis"

Where it slips in: A distance with no left or right given.

Don't do this: Give only x=4x = 4.

The correct way: Give both lines, x=4x = 4 and x=−4x = -4.

Where Does the Equation x = a Show Up in the Real World?

A line x=ax = a is perfect verticality: a fixed across-position while something varies up and down.

  • Building: a plumb line hangs along a true vertical, x=ax = a on a drawing. Builders use it to check walls are upright.
  • Screens: every pixel in one column shares the same x-address.
  • Charts: a marker line at noon, t=12t = 12, holds the time fixed whatever the temperature.
a plumb line hangs along a line parallel to the y-axis
A plumb line hanging from a bracket beside a wall, its string along x = 3 with the points (3, 3), (3, 1) and (3, −0.6) marked, and an orange bob at the bottom.

Builders have used the plumb bob for thousands of years. Since René Descartes' La Géométrie (1637), that vertical can be written as a line whose x never changes.

Conclusion

  • A line parallel to the y-axis is x=ax = a; the y-axis itself is x=0x = 0.
  • One number writes it: the x-coordinate of any point on the line.
  • Its slope is undefined, not zero.
  • It has no y=mx+cy = mx + c form and is not a function of xx.
  • The equation always starts with xx, never yy.

Read More

Practice These to Solidify Your Understanding

Work through these in order:

  1. Write the line parallel to the y-axis through (−9,3)(-9, 3).
  2. Give both lines that are 5 units from the y-axis.
  3. Find where x=−1x = -1 meets 2x+3y=72x + 3y = 7.
  4. Find the distance between x=−2x = -2 and x=6x = 6.

Answers:

  1. x=−9x = -9.
  2. x=5x = 5 and x=−5x = -5.
  3. −2+3y=7-2 + 3y = 7, so y=3y = 3: the point (−1,3)(-1, 3).
  4. 8 units.

Got y=3y = 3 or y=−9y = -9 for the first one? Reread Mistake 1. Next, notice that x=ax = a and y=by = b always cross at (a,b)(a, b).

To take coordinate geometry further with a teacher, explore Bhanzu's geometry tutor, a high school math tutor, or math classes online for guided straight-line practice.

Want a live Bhanzu trainer to walk your child through vertical and horizontal lines? Book a free demo class, online globally, or in person at our McKinney, TX center.

Research Behind This Article

  1. OpenStax, College Algebra 2e, Section 4.1: Linear Functions (vertical lines and their undefined slope). openstax.org
  2. OpenStax, Precalculus 2e, Section 2.2: Graphs of Linear Functions (horizontal, vertical, parallel and perpendicular lines). openstax.org
  3. OpenStax, Precalculus 2e, Section 2.1: Linear Functions (slope and the forms of a line). openstax.org
  4. J. J. O'Connor and E. F. Robertson, René Descartes, MacTutor History of Mathematics, University of St Andrews (coordinates that turn lines into equations). mathshistory.st-andrews.ac.uk

Quick Quiz: Check Yourself

Three levels, questions with figures, instant feedback with the reason.

Was this article helpful?

Your feedback helps us write better content

Frequently Asked Questions

What is the equation of a line parallel to the y-axis?
It is x=ax = a, where aa is the x-coordinate of every point on the line.
What is the slope of a line parallel to the y-axis?
Undefined. The run between any two points is 0, and dividing by 0 gives no number.
Is x = a a function?
Not of xx: one input has infinitely many outputs, so it fails the vertical line test. As a function of yy, it is constant.
How is it different from a line parallel to the x-axis?
That line is y=by = b: flat, with slope 0. The two always cross at a right angle, at (a,b)(a, b).
Is a vertical line the same as a line parallel to the y-axis?
Yes, both are x=ax = a. "Vertical" names the direction; "parallel to the y-axis" names the axis it runs beside.
What is required to find the equation of a line parallel to the y-axis?
Only the x-coordinate of one point on the line. The y-coordinate is never needed.
✍️ Written By
Ashish Chauhan
Ashish Chauhan
Math Curriculum Developer
Ashish Chauhan is a Mathematics and Science educator and curriculum developer with 6+ years of experience teaching students from Grades 3–12. He specializes in simplifying complex concepts through conceptual, student-centered learning and has worked across CBSE, PSEB, and international curricula. Beyond teaching, Ashish develops K–12 educational content, lesson plans, and assessments aligned with US learning standards. He holds a BS in PCM and an MS in Chemistry, bringing a strong STEM foundation to education and curriculum design.
🔬 Reviewed By
Shikha Sharma
Subject Matter Expert
Book a FREE Demo ClassBook Now →