Skip to the page
Home Campus
Start free

Horizontal and Vertical Lines

The lines y=ky = k and x=hx = h: what they look like, their gradients, the axes as lines, where they meet other lines, and the areas they enclose.

Before you start

  • A horizontal line has gradient 00: going along it, the vertical change is 00 (Secondary 1).
  • The graph of ax+by=cax + by = c is a straight line. Its xx-intercept is found by putting y=0y = 0 and its yy-intercept by putting x=0x = 0 (lesson 2.2).

Horizontal Lines: y = k

In ax+by=cax + by = c, aa may be 00. Then the equation has no xx term: for example 0x+3y=60x + 3y = 6, which is 3y=63y = 6, or y=2y = 2.

The equation y=2y = 2 says nothing about xx, so xx can be any number, and yy is always 22: (−3,2)(-3, 2), (0,2)(0, 2) and (5,2)(5, 2) are all solutions. These points are all at the same height, so they lie on a horizontal line.

The line y = k

The graph of y=ky = k, where kk is a number, is the horizontal line through (0,k)(0, k). Every point on it has yy-coordinate kk.

It is parallel to the xx-axis. Its gradient is 00: between any two of its points the vertical change is 00.

Vertical Lines: x = h

If b=0b = 0, the equation has no yy term: for example 2x+0y=−62x + 0y = -6, which is 2x=−62x = -6, or x=−3x = -3. Now yy can be any number and xx is always −3-3: (−3,−4)(-3, -4), (−3,0)(-3, 0) and (−3,1.5)(-3, 1.5) all lie on it, one above another, on a vertical line.

The line x = h

The graph of x=hx = h, where hh is a number, is the vertical line through (h,0)(h, 0). Every point on it has xx-coordinate hh.

It is parallel to the yy-axis. Its gradient is undefined: between any two of its points the horizontal change is 00, and a vertical change cannot be divided by 00.

A vertical line cannot be written in the form y=mx+cy = mx + c (lesson 2.3): on it one value of xx goes with every value of yy, so yy cannot be found from xx. (Its equation has no yy term, so yy cannot be made the subject.)

Example 1: Drawing horizontal and vertical lines

On one pair of axes, draw the lines y=2y = 2, y=−3y = -3, x=4x = 4 and x=−1x = -1. State the gradient of each.

Solution

y=2y = 2: the horizontal line through (0,2)(0, 2), 22 units above the xx-axis.

y=−3y = -3: the horizontal line through (0,−3)(0, -3), 33 units below the xx-axis.

x=4x = 4: the vertical line through (4,0)(4, 0), 44 units to the right of the yy-axis.

x=−1x = -1: the vertical line through (−1,0)(-1, 0), 11 unit to the left of the yy-axis.

The horizontal lines y = 2 and y = −3 and the vertical lines x = 4 and x = −1, drawn on axes from −5 to 5xy−5−4−3−2−112345−5−4−3−2−112345Oy = 2y = −3x = 4x = −1

y=2y = 2 and y=−3y = -3 are horizontal, with gradient 00; x=4x = 4 and x=−1x = -1 are vertical, with gradient undefined.

The Axes, Lines Through a Point, and Tidying an Equation

The axes as lines

Every point on the xx-axis has yy-coordinate 00, so the xx-axis is the line y=0y = 0.

Every point on the yy-axis has xx-coordinate 00, so the yy-axis is the line x=0x = 0.

Example 2: Lines through a given point

Write down the equation of the line through (3,−2)(3, -2) that is (a) parallel to the xx-axis, (b) parallel to the yy-axis.

Solution

(a) A line parallel to the xx-axis is horizontal. Every point on it has the same yy-coordinate as (3,−2)(3, -2), which is −2-2: y=−2y = -2.

(b) A line parallel to the yy-axis is vertical. Every point on it has the same xx-coordinate, 33: x=3x = 3.

The point (3, −2) with the horizontal line y = −2 and the vertical line x = 3 through itxy−2−112345−4−3−2−1123Oy = −2x = 3(3, −2)

(a) y=−2y = -2 (b) x=3x = 3

An equation with only one variable in it may need tidying before you can see which line it is. Solve it for that variable.

Example 3: Tidying an equation

Write each equation in the form y=ky = k or x=hx = h and say whether its graph is horizontal or vertical. (a) 2y−6=02y - 6 = 0 (b) 3x+12=03x + 12 = 0 (c) 5−y=15 - y = 1 (d) 4x=04x = 0

Solution

(a) Add 66: 2y=62y = 6. Divide by 22: y=3y = 3. Horizontal.

(b) Subtract 1212: 3x=−123x = -12. Divide by 33: x=−4x = -4. Vertical.

(c) Add yy to both sides and subtract 11: 4=y4 = y, so y=4y = 4. Horizontal.

(d) Divide by 44: x=0x = 0. Vertical: it is the yy-axis itself.

(a) y=3y = 3, horizontal (b) x=−4x = -4, vertical (c) y=4y = 4, horizontal (d) x=0x = 0, vertical (the yy-axis)

Example 4: Which points lie on the line?

Which of the points A(−2,5)A(-2, 5), B(2,−2)B(2, -2), C(−2,0)C(-2, 0) and D(0,−2)D(0, -2) lie on (a) x=−2x = -2, (b) y=−2y = -2?

Solution

(a) A point lies on x=−2x = -2 when its xx-coordinate is −2-2, whatever its yy-coordinate: AA and CC.

(b) A point lies on y=−2y = -2 when its yy-coordinate is −2-2: BB and DD.

Take care with B(2,−2)B(2, -2) and D(0,−2)D(0, -2): they contain the number −2-2, but as the yy-coordinate, so they are not on x=−2x = -2.

(a) AA and CC (b) BB and DD

Where Lines Meet

The point where two lines meet lies on both, so its coordinates make both equations true.

A vertical line x=hx = h and a horizontal line y=ky = k always meet, at (h,k)(h, k). To find where x=hx = h meets a sloping line, put x=hx = h into the sloping line's equation and solve for yy; for y=ky = k, put y=ky = k in and solve for xx.

Example 5: Meeting points

Find the point where (a) x=3x = 3 meets y=−1y = -1, (b) x=2x = 2 meets 2x+y=72x + y = 7, (c) y=−1y = -1 meets 2x−y=52x - y = 5.

Solution

(a) The point has x=3x = 3 and y=−1y = -1: (3,−1)(3, -1).

(b) The point has x=2x = 2. Put it into 2x+y=72x + y = 7: 4+y=74 + y = 7, so y=3y = 3. The point is (2,3)(2, 3). Check: 2(2)+3=72(2) + 3 = 7.

The vertical line x = 2 and the line 2x + y = 7, through (0, 7) and (3.5, 0), meeting at (2, 3)xy−112345−2−112345678Ox = 22x + y = 7(2, 3)

(c) The point has y=−1y = -1. Put it into 2x−y=52x - y = 5: 2x−(−1)=52x - (-1) = 5, so 2x+1=52x + 1 = 5, 2x=42x = 4 and x=2x = 2. The point is (2,−1)(2, -1). Check: 2(2)−(−1)=4+1=5.2(2) - (-1) = 4 + 1 = 5\text{.}

(a) (3,−1)(3, -1) (b) (2,3)(2, 3) (c) (2,−1)(2, -1)

Areas Enclosed by Lines

Horizontal and vertical lines, the axes and a sloping line can enclose a rectangle or a triangle. Find the corners as meeting points first. A length along a horizontal or vertical side is the difference of the coordinates at its ends, and it is never negative.

Example 6: A rectangle

The lines x=4x = 4 and y=3y = 3 and the two axes enclose a rectangle. Find its area and its perimeter.

Solution

The axes are x=0x = 0 and y=0y = 0. The corners are where the lines meet: (0,0)(0, 0), (4,0)(4, 0), (4,3)(4, 3) and (0,3)(0, 3).

The lines x = 4 and y = 3 with the axes, enclosing the shaded rectangle with corners (0, 0), (4, 0), (4, 3) and (0, 3)xy−1123456−112345Ox = 4y = 3(4, 3)

Width: from x=0x = 0 to x=4x = 4, 44 units. Height: from y=0y = 0 to y=3y = 3, 33 units.

Area =4×3=12= 4 \times 3 = 12 square units. Perimeter =2×(4+3)=14= 2 \times (4 + 3) = 14 units.

The area is 1212 square units and the perimeter is 1414 units.

Example 7: A triangle with a sloping side

The lines y=1y = 1, x=1x = 1 and x+y=5x + y = 5 enclose a triangle. Find the coordinates of its corners and its area.

Solution

x=1x = 1 meets y=1y = 1 at (1,1)(1, 1).

x=1x = 1 meets x+y=5x + y = 5: 1+y=51 + y = 5, so y=4y = 4, at (1,4)(1, 4).

y=1y = 1 meets x+y=5x + y = 5: x+1=5x + 1 = 5, so x=4x = 4, at (4,1)(4, 1).

The lines y = 1, x = 1 and x + y = 5 enclosing the shaded right-angled triangle with corners (1, 1), (4, 1) and (1, 4)xy−1123456−1123456Oy = 1x = 1x + y = 5(1, 1)(1, 4)(4, 1)

The triangle has a right angle at (1,1)(1, 1). Its base along y=1y = 1 is 4−1=34 - 1 = 3 units and its height along x=1x = 1 is 4−1=34 - 1 = 3 units.

Area =12×3×3=4.5= \frac{1}{2} \times 3 \times 3 = 4.5 square units.

The corners are (1,1)(1, 1), (1,4)(1, 4) and (4,1)(4, 1), and the area is 4.54.5 square units.

Equations from a Graph

Example 8: Reading the equations

Write down the equations of the lines AA, BB, CC and DD.

Four lines: A horizontal through (0, 3); B vertical through (−2, 0); C horizontal through (0, −2.5); D vertical through (4, 0)xy−5−4−3−2−1123456−4−3−2−112345OABCD

Solution

AA is horizontal and crosses the yy-axis at 33: every point on it has y=3y = 3.

BB is vertical and crosses the xx-axis at −2-2: every point on it has x=−2x = -2.

CC is horizontal, halfway between −2-2 and −3-3 on the yy-axis: y=−2.5y = -2.5.

DD is vertical through 44 on the xx-axis: x=4x = 4.

AA: y=3y = 3; BB: x=−2x = -2; CC: y=−2.5y = -2.5; DD: x=4x = 4.

Common Mistakes

  • Drawing x=3x = 3 across the page. x=3x = 3 is the line where xx is always 33, so it runs up and down through (3,0)(3, 0). y=3y = 3 runs across.
  • Calling the xx-axis x=0x = 0. On the xx-axis it is yy that is 00: the xx-axis is y=0y = 0 and the yy-axis is x=0x = 0.
  • Saying a vertical line has gradient 00. Gradient 00 belongs to a horizontal line; the gradient of a vertical line is undefined.
  • Losing a minus sign in a length. The side from x=−4x = -4 to x=2x = 2 is 2−(−4)=62 - (-4) = 6 units long, not 22.

Practice Questions

Work each question on paper before you open its solution. The questions get harder as you go.

Question 1

For each equation, say whether its graph is horizontal or vertical, and give its gradient. (a) y=−4y = -4 (b) x=7x = 7 (c) 0x+5y=150x + 5y = 15 (d) 4x+0y=−24x + 0y = -2

ShowHide solution

(a) Horizontal; gradient 00.

(b) Vertical; gradient undefined.

(c) 5y=155y = 15, so y=3y = 3: horizontal; gradient 00.

(d) 4x=−24x = -2, so x=−0.5x = -0.5: vertical; gradient undefined.

(a) horizontal, 00 (b) vertical, undefined (c) y=3y = 3, horizontal, 00 (d) x=−0.5x = -0.5, vertical, undefined

Question 2

On one pair of axes, draw the lines x=−3x = -3, x=2.5x = 2.5, y=4y = 4 and y=−1y = -1.

ShowHide solution

x=−3x = -3 and x=2.5x = 2.5 are vertical, through (−3,0)(-3, 0) and (2.5,0)(2.5, 0). y=4y = 4 and y=−1y = -1 are horizontal, through (0,4)(0, 4) and (0,−1)(0, -1).

The vertical lines x = −3 and x = 2.5 and the horizontal lines y = 4 and y = −1xy−5−4−3−2−112345−3−2−1123456Ox = −3x = 2.5y = 4y = −1

Two vertical lines through −3-3 and 2.52.5 on the xx-axis, and two horizontal lines through 44 and −1-1 on the yy-axis.

Question 3

Write down the equation of (a) the xx-axis, (b) the line through (−5,6)(-5, 6) parallel to the yy-axis, (c) the line through (−5,6)(-5, 6) parallel to the xx-axis, (d) the line through (2,7)(2, 7) and (2,−3)(2, -3), (e) the line through (−1,4)(-1, 4) and (6,4)(6, 4).

ShowHide solution

(a) Every point on the xx-axis has y=0y = 0: y=0y = 0.

(b) Vertical, with the xx-coordinate of (−5,6)(-5, 6): x=−5x = -5.

(c) Horizontal, with the yy-coordinate of (−5,6)(-5, 6): y=6y = 6.

(d) Both points have xx-coordinate 22, so the line is vertical: x=2x = 2.

(e) Both points have yy-coordinate 44, so the line is horizontal: y=4y = 4.

(a) y=0y = 0 (b) x=−5x = -5 (c) y=6y = 6 (d) x=2x = 2 (e) y=4y = 4

Question 4

Write each equation in the form y=ky = k or x=hx = h. (a) 4y+8=04y + 8 = 0 (b) 2x−7=02x - 7 = 0 (c) 3(y−1)=63(y - 1) = 6 (d) 5x=2x+95x = 2x + 9

ShowHide solution

(a) 4y=−84y = -8, so y=−2y = -2.

(b) 2x=72x = 7, so x=3.5x = 3.5.

(c) Divide by 33: y−1=2y - 1 = 2, so y=3y = 3.

(d) Subtract 2x2x: 3x=93x = 9, so x=3x = 3.

(a) y=−2y = -2 (b) x=3.5x = 3.5 (c) y=3y = 3 (d) x=3x = 3

Question 5

Which of the points P(3,−3)P(3, -3), Q(−3,3)Q(-3, 3), R(3,0)R(3, 0) and S(0,3)S(0, 3) lie on (a) x=3x = 3, (b) y=3y = 3?

ShowHide solution

(a) xx-coordinate 33: PP and RR.

(b) yy-coordinate 33: QQ and SS.

(a) PP and RR (b) QQ and SS

Question 6

Find the point where (a) x=−4x = -4 meets y=5y = 5, (b) y=6y = 6 meets 3x−2y=03x - 2y = 0, (c) x=−1x = -1 meets x+2y=9x + 2y = 9, (d) the xx-axis meets 5x+2y=155x + 2y = 15.

ShowHide solution

(a) (−4,5)(-4, 5).

(b) Put y=6y = 6: 3x−12=03x - 12 = 0, so 3x=123x = 12 and x=4x = 4: (4,6)(4, 6). Check: 12−12=012 - 12 = 0.

(c) Put x=−1x = -1: −1+2y=9-1 + 2y = 9, so 2y=102y = 10 and y=5y = 5: (−1,5)(-1, 5). Check: −1+10=9-1 + 10 = 9.

(d) The xx-axis is y=0y = 0: 5x=155x = 15, so x=3x = 3: (3,0)(3, 0).

(a) (−4,5)(-4, 5) (b) (4,6)(4, 6) (c) (−1,5)(-1, 5) (d) (3,0)(3, 0)

Question 7

Write down the equations of the lines EE, FF and GG, and the coordinates of the point where EE and FF meet.

Three lines: E vertical through (3, 0); F horizontal through (0, −3); G vertical through (−4, 0)xy−5−4−3−2−112345−5−4−3−2−11234OEFG
ShowHide solution

EE is vertical through 33 on the xx-axis: x=3x = 3.

FF is horizontal through −3-3 on the yy-axis: y=−3y = -3.

GG is vertical through −4-4 on the xx-axis: x=−4x = -4.

EE and FF meet where x=3x = 3 and y=−3y = -3: (3,−3)(3, -3).

EE: x=3x = 3; FF: y=−3y = -3; GG: x=−4x = -4. EE and FF meet at (3,−3)(3, -3).

Question 8

The lines x=−2x = -2, x=3x = 3, y=−1y = -1 and y=3y = 3 enclose a rectangle. Find its area and its perimeter.

ShowHide solution

Width: from x=−2x = -2 to x=3x = 3 is 3−(−2)=53 - (-2) = 5 units. Height: from y=−1y = -1 to y=3y = 3 is 3−(−1)=43 - (-1) = 4 units.

Area =5×4=20= 5 \times 4 = 20 square units. Perimeter =2×(5+4)=18= 2 \times (5 + 4) = 18 units.

Area 2020 square units, perimeter 1818 units.

Question 9

The yy-axis and the lines y=1y = 1 and x+2y=8x + 2y = 8 enclose a triangle. Find its corners and its area.

ShowHide solution

The yy-axis is x=0x = 0. It meets y=1y = 1 at (0,1)(0, 1).

x=0x = 0 in x+2y=8x + 2y = 8: 2y=82y = 8, y=4y = 4, at (0,4)(0, 4).

y=1y = 1 in x+2y=8x + 2y = 8: x+2=8x + 2 = 8, x=6x = 6, at (6,1)(6, 1).

The y-axis, the line y = 1 and the line x + 2y = 8 enclosing the shaded triangle with corners (0, 1), (6, 1) and (0, 4)xy−1123456789−1123456Oy = 1x + 2y = 8(0, 4)(6, 1)(0, 1)

The right angle is at (0,1)(0, 1). Base 6−0=66 - 0 = 6 units, height 4−1=34 - 1 = 3 units. Area =12×6×3=9= \frac{1}{2} \times 6 \times 3 = 9 square units.

Corners (0,1)(0, 1), (0,4)(0, 4) and (6,1)(6, 1); area 99 square units.

Question 10

The lines x=1x = 1, x=5x = 5, y=2y = 2 and y=ky = k enclose a rectangle of area 2020 square units. Find the two possible values of kk.

ShowHide solution

The width is 5−1=45 - 1 = 4 units, so the height is 20÷4=520 \div 4 = 5 units.

The line y=ky = k is 55 units above or below y=2y = 2: k=2+5=7k = 2 + 5 = 7 or k=2−5=−3k = 2 - 5 = -3.

The lines x = 1, x = 5 and y = 2, with the two possible lines y = 7 and y = −3 dashed; each encloses a rectangle 4 by 5xy−11234567−4−3−2−112345678Ox = 1x = 5y = 2y = 7y = −3

k=7k = 7 or k=−3k = -3

Question 11

A car park charges a flat $33 for any stay of up to 4 hours. (a) Draw the graph of the charge, $CC, against the time, tt hours, for 0<t≤40 < t \le 4. (b) Write down its equation and its gradient, and say what the gradient means.

ShowHide solution

(a) Whatever the time, the charge is $33: a horizontal line at C=3C = 3 from t=0t = 0 to t=4t = 4, with an open circle at (0,3)(0, 3), since t=0t = 0 is not included, and a filled dot at (4,3)(4, 3), since t=4t = 4 is.

The car park charge: a horizontal line at C = 3 from t = 0 to t = 4, with an open circle at (0, 3) and a filled dot at (4, 3)Time (hours), tCharge ($), C1234512345OC = 3

(b) The equation is C=3C = 3, with gradient 00: the charge does not change as the time goes on.

(b) C=3C = 3; gradient 00, because the charge stays at $33 however long the stay (up to 4 hours).

Question 12

A rectangular garden plot is marked out by the lines x=0x = 0, y=0y = 0, x=6x = 6 and y=ky = k, where k>0k > 0 and 1 unit stands for 1 m. Fencing all round it costs $1515 per metre, and the fence costs $300300. Find kk and the area of the plot.

ShowHide solution

Length of fence =300÷15=20= 300 \div 15 = 20 m.

The plot is 66 m by kk m, so its perimeter is 2(6+k)=202(6 + k) = 20. Divide by 22: 6+k=106 + k = 10, so k=4k = 4.

Area =6×4=24= 6 \times 4 = 24 m2^{2}.

k=4k = 4; the area is 2424 m2^{2}.

Key Points

  • y=ky = k is the horizontal line through (0,k)(0, k); its gradient is 00. It is ax+by=cax + by = c with a=0a = 0.
  • x=hx = h is the vertical line through (h,0)(h, 0); its gradient is undefined. It is ax+by=cax + by = c with b=0b = 0.
  • The xx-axis is y=0y = 0 and the yy-axis is x=0x = 0.
  • The line through (p,q)(p, q) parallel to the xx-axis is y=qy = q; parallel to the yy-axis, x=px = p.
  • Tidy an equation in one variable by solving it: 2y−6=02y - 6 = 0 is y=3y = 3.
  • x=hx = h and y=ky = k meet at (h,k)(h, k). To meet a sloping line, substitute and solve.
  • For an enclosed area, find the corners first; lengths are differences of coordinates and never negative.

‹ 2.3 Gradient and Intercepts of ax + by = c 2.5 Solving Simultaneous Equations by Graphs ›

All Secondary 2 (Grade 8) lessons

Home Campus has lessons, practice questions with worked solutions and worksheets for Primary 3 to Secondary 1. Register free to practise and keep track of progress.

This lesson follows the Singapore Secondary 2 syllabus and was checked question by question before it was published. Spotted a mistake? Tell us.