Back to homeMathematics · Geometry · Change subject
Start for free
Geometry · Mathematics
Coordinate geometry · Coordinate geometry

Horizontal and Vertical Lines

Picture a city map laid out as a grid, like downtown Chicago. Walk east along one street and your north-south position never changes. Walk north along an avenue and your east-west position never changes. Those "never changes" paths are the simplest lines in the coordinate plane, and you can write each one with a single short equation. How? Let's find out.

Horizontal lines

Why does this work? Moving along a horizontal line, you never go up or down, so $y$ stays the same while $x$ takes any value.

Graph of the horizontal line y = 6 with the points (1, 6), (4, 6) and (8, 6) marked on it (1, 6) (4, 6) (8, 6) y = 6

Use the slider to move a horizontal line up and down. Only $y$ changes; the line stays flat.

Practice★☆☆Not started
Write down the equation of the line parallel to the x-axis ($X$-axis) that passes through the point $A(3, -5)$.

Write down the equation of the line parallel to the x-axis ($X$-axis) that passes through the point $A(3, -5)$.

Solve

Vertical lines and the axes

Moving along a vertical line you go straight up or down, so $x$ never changes while $y$ takes any value.

Graph of the vertical line x = 7 with the points (7, 1), (7, 3) and (7, 5) marked on it (7, 1) (7, 3) (7, 5) x = 7

The two coordinate axes are special cases of these lines:

Line Equation
x-axis $y = 0$
y-axis $x = 0$
Practice★☆☆Not started
Write down the equation of the line parallel to the y-axis ($Y$-axis) that passes through the point $B(-2, 7)$.

Write down the equation of the line parallel to the y-axis ($Y$-axis) that passes through the point $B(-2, 7)$.

Solve
Practice★☆☆Not started
Write down the general equations of the coordinate axes $X$ and $Y$.

Write down the general equations of the coordinate axes $X$ and $Y$.

Solve
Practice★★☆Not started
A delivery drone moves through a city with grid-like streets. Its path follows a straight line parallel to the $Y$-axis passing through the coordinate $(6, 2)$. Write…

A delivery drone moves through a city with grid-like streets. Its path follows a straight line parallel to the $Y$-axis passing through the coordinate $(6, 2)$. Write down the equation of its path and the coordinates of two points it will pass through.

Solve

Intersections and perpendicular lines

A vertical line $x = a$ and a horizontal line $y = b$ always cross at exactly one point: $(a, b)$. They also meet at a right angle, so a vertical line is perpendicular to every horizontal line.

The horizontal line y = 2 and the vertical line x = 3 cross at a right angle at the point (3, 2) (3, 2) y = 2 x = 3

To find where a horizontal or vertical line meets another line, substitute the known value into the other equation.

To find the line perpendicular to a given horizontal or vertical line, just flip the type. The perpendicular to $y = 5$ through $(2, 9)$ is vertical, so it is $x = 2$.

Practice★☆☆Not started
Determine the coordinates of the point of intersection of the lines $r: x = 5$ and $s: y = -2$.

Determine the coordinates of the point of intersection of the lines $r: x = 5$ and $s: y = -2$.

Solve
Practice★★☆Not started
Find the equation of the line perpendicular to $x = 7$ that passes through the point $M(-4, 9)$.

Find the equation of the line perpendicular to $x = 7$ that passes through the point $M(-4, 9)$.

Solve
Practice★★★Not started
An electronic components factory has fixed monthly costs of $12000\text{ \$}$, regardless of the quantity $x$ of parts manufactured. The revenue is given by the line $y…

An electronic components factory has fixed monthly costs of $12000\text{ \$}$, regardless of the quantity $x$ of parts manufactured. The revenue is given by the line $y = 30x$. Write the equation of the fixed cost line on the $(x, y)$ plane and find the exact point where the revenue equals the fixed costs.

Solve

Slope and direction vector

A direction vector $\langle a, b\rangle$ of a line points along the line: moving $a$ units right and $b$ units up keeps you on it. The slope is then $m = \dfrac{b}{a}$, which is "rise over run".

  • A horizontal line has direction vector $\langle 1, 0\rangle$: run $1$, rise $0$. So $m = \dfrac{0}{1} = 0$.

  • A vertical line has direction vector $\langle 0, 1\rangle$: run $0$, rise $1$. The slope $\dfrac{1}{0}$ is undefined, because you can't divide by $0$.

Any nonzero multiple works too. For example, $\langle 5, 0\rangle$ is also a direction vector of a horizontal line. Some problems call the slope the gradient; it is the same number.

A horizontal line with direction vector ⟨1, 0⟩ and slope 0, next to a vertical line with direction vector ⟨0, 1⟩ and undefined slope y = −6 x = 9 direction ⟨1, 0⟩ slope = 0 direction ⟨0, 1⟩ slope undefined
Practice★☆☆Not started
State the direction vector and the gradient of the line with equation $y = 4$.

State the direction vector and the gradient of the line with equation $y = 4$.

Solve
Practice★☆☆Not started
State the direction vector and the gradient of the line with equation $x = -1$.

State the direction vector and the gradient of the line with equation $x = -1$.

Solve
Practice★★☆Not started
In a chemistry experiment, the temperature $T$ (in degrees Fahrenheit) is kept constant at $35^\circ\text{C}$ over time $t$ (in minutes). Representing time on the…

In a chemistry experiment, the temperature $T$ (in degrees Fahrenheit) is kept constant at $35^\circ\text{C}$ over time $t$ (in minutes). Representing time on the $X$-axis and temperature on the $Y$-axis, write down the equation of the line and its direction vector.

Solve

Parametric and general equations

A line can also be described by a starting point $(x_0, y_0)$ and a direction vector $\langle a, b\rangle$:

$$x = x_0 + at, \qquad y = y_0 + bt$$

As the parameter $t$ changes, the point $(x, y)$ slides along the line.

For lines parallel to the axes this gets very simple:

  • Horizontal line $y = k$: $x = t,\; y = k$. (Direction vector $\langle 1, 0\rangle$.)

  • Vertical line $x = k$: $x = k,\; y = t$. (Direction vector $\langle 0, 1\rangle$.)

The general equation puts everything on one side: $Ax + By + C = 0$. It is the same idea as standard form $Ax + By = C$. For example, $y = 2$ becomes $y - 2 = 0$, and $x = -3$ becomes $x + 3 = 0$.

The vertical line x = −3 with points for t = −1, 0, 1 and 2, whose x-coordinate stays −3 while y equals t t = −1 t = 0 t = 1 t = 2 x = −3
Practice★☆☆Not started
Given the line in parametric form $x = -3$, $y = t$, state which axis it is parallel to and write down its general equation.

Given the line in parametric form $x = -3$, $y = t$, state which axis it is parallel to and write down its general equation.

Solve
Practice★★☆Not started
The printhead of a 3D printer must draw a constant horizontal support line at $15\text{ mm}$ from the origin on the $Y$-axis. Write down the parametric equations and the…

The printhead of a 3D printer must draw a constant horizontal support line at $15\text{ mm}$ from the origin on the $Y$-axis. Write down the parametric equations and the general equation of this line.

Solve

Recognizing them from two points

Drag the point below to $(-3, 2)$ and then to $(4, 2)$. What stays the same?

A stepped path (two segments, one parallel to each axis) is just one horizontal line and one vertical line.

Altitudes. An altitude of a triangle is perpendicular to a side. If that side is horizontal, the altitude is vertical, and the other way around.

Practice★☆☆Not started
A line passes through the points $P(4, 2)$ and $Q(-3, 2)$. Is it parallel to either of the axes? Write down its equation.

A line passes through the points $P(4, 2)$ and $Q(-3, 2)$. Is it parallel to either of the axes? Write down its equation.

Solve
Practice★★★Not started
A robotic arm must move from the point $P(-2, -5)$ to the point $Q(4, 7)$ following a stepped path composed of two segments: first a movement parallel to the $X$-axis…

A robotic arm must move from the point $P(-2, -5)$ to the point $Q(4, 7)$ following a stepped path composed of two segments: first a movement parallel to the $X$-axis and then a movement parallel to the $Y$-axis. Write the equations of the lines that contain these two segments.

Solve
Practice★★★Not started
Given the triangle with vertices $A(-3, 2)$, $B(5, 2)$ and $C(1, 8)$, find the equation of the altitude from vertex $C$. Which axis is this altitude parallel to?

Given the triangle with vertices $A(-3, 2)$, $B(5, 2)$ and $C(1, 8)$, find the equation of the altitude from vertex $C$. Which axis is this altitude parallel to?

Solve

Spotting them in general form

In $Ax + By + C = 0$, a line parallel to an axis is missing one variable:

  • If $B = 0$ (no $y$ term), then $Ax + C = 0$, so $x = -\dfrac{C}{A}$. The line is vertical.

  • If $A = 0$ (no $x$ term), then $By + C = 0$, so $y = -\dfrac{C}{B}$. The line is horizontal.

In both cases, the coefficients $A$ and $B$ can't both be $0$, or there is no line at all.

Comparison of the vertical line x = −C/A and the horizontal line y = −C/B obtained from the general equation x = −C/A y = −C/B Ax + C = 0(no y term, B = 0)→ vertical line By + C = 0(no x term, A = 0)→ horizontal line

When both coefficients depend on a parameter, check that they don't vanish together.

Practice★★☆Not started
Determine the value of $k$ so that the line with general equation $kx + 3y - 6 = 0$ is parallel to the $X$-axis. Write down the resulting equation.

Determine the value of $k$ so that the line with general equation $kx + 3y - 6 = 0$ is parallel to the $X$-axis. Write down the resulting equation.

Solve
Practice★★☆Not started
Determine the value of $a$ so that the line with equation $4x + (a+1)y - 8 = 0$ is parallel to the $Y$-axis. Write down the resulting equation.

Determine the value of $a$ so that the line with equation $4x + (a+1)y - 8 = 0$ is parallel to the $Y$-axis. Write down the resulting equation.

Solve
Practice★★★Not started
Find the value of $m$ so that the line $(m^2-9)x + (m+3)y + 5 = 0$ is parallel to the $X$-axis. Is there any value of $m$ for which this same line is parallel to the…

Find the value of $m$ so that the line $(m^2-9)x + (m+3)y + 5 = 0$ is parallel to the $X$-axis. Is there any value of $m$ for which this same line is parallel to the $Y$-axis? Justify your answer.

Solve

Distances and relative position

The horizontal lines y = 8 and y = −3 with a vertical segment of length 11 units between them 11 units y = 8 y = −3

Relative position of two lines. When one of the lines is $y = k$ or $x = h$, substitute it into the other equation. The result tells you whether the lines are parallel, coincident (the same line), or intersecting.

Practice★★☆Not started
Calculate the minimum distance separating the parallel lines $r: y = 8$ and $s: y = -3$.

Calculate the minimum distance separating the parallel lines $r: y = 8$ and $s: y = -3$.

Solve
Practice★★★Not started
A drip irrigation system is installed along a pipe parallel to the $Y$-axis. We know that the pipe must water a tree located at the point $A(5, 12)$ and that the exact…

A drip irrigation system is installed along a pipe parallel to the $Y$-axis. We know that the pipe must water a tree located at the point $A(5, 12)$ and that the exact distance from the pipe to the $Y$-axis is $5\text{ m}$. Write down the equation of the line representing the pipe.

Solve
Practice★★★Not started
Determine the relative position of the line $r: x = 4$ and the line $s: 2x + ky - 8 = 0$ depending on the parameter $k$.

Determine the relative position of the line $r: x = 4$ and the line $s: 2x + ky - 8 = 0$ depending on the parameter $k$.

Solve

Rectangles aligned with the axes

The sides of any rectangle whose sides are parallel to the axes lie on two horizontal and two vertical lines. Basketball courts, phone screens, and floor plans are full of them.

A basketball court 94 feet by 50 feet centered at the origin, bounded by the lines x = −47, x = 47, y = 25 and y = −25 y = 25 y = −25 x = −47 x = 47

Back to the city grid: walking along a street keeps your north-south position fixed, which is a horizontal line $y = k$. Walking along an avenue keeps your east-west position fixed, which is a vertical line $x = h$. Where a street and an avenue cross, you are at the point $(h, k)$.

Practice★★☆Not started
On a soccer field, we represent the center of the field at the origin $(0,0)$. If the field is $100\text{ m}$ long (located on the $X$-axis) and $60\text{ m}$ wide…

On a soccer field, we represent the center of the field at the origin $(0,0)$. If the field is $100\text{ m}$ long (located on the $X$-axis) and $60\text{ m}$ wide (located on the $Y$-axis), write down the equations of the four straight lines that bound the playing field.

Solve
Practice★★★Not started
In the development of a video game, the screen has a resolution of $1920 \times 1080$ pixels. If we place the origin $(0,0)$ at the bottom-left corner, write the…

In the development of a video game, the screen has a resolution of $1920 \times 1080$ pixels. If we place the origin $(0,0)$ at the bottom-left corner, write the equations of the two lines (one horizontal and one vertical) that divide the screen exactly into four equal quadrants.

Solve
Practice★★★Not started
A square has its center at the point $C(3, 3)$ and its sides are parallel to the coordinate axes. If the side of the square measures $4\text{ u}$, write the equations of…

A square has its center at the point $C(3, 3)$ and its sides are parallel to the coordinate axes. If the side of the square measures $4\text{ u}$, write the equations of the four lines that contain its sides.

X Y C(3,3) 1 5 1 5 0
Solve

Summary

See all the exercises in this section