← IGCSE / O Level Mathematics

IGCSE / O Level Mathematics · Topic 3 Coordinate geometry · Chapter 21 · pp. 250–276

Straight-line graphs

Every point on a grid has two coordinates, and every straight line has a gradient (how steep) and an equation (the rule its points obey). This chapter reads and draws lines, finds their equations, solves two equations at once by finding where lines cross, and measures a line segment.

Learning objectives

  1. Read and plot coordinates in all four quadrants, and use them to describe shapes.
  2. Read the value of a point on a scale that is not marked in whole numbers.
  3. Find the gradient of a line from two points, including horizontal and vertical lines.
  4. Write the equation of a line as y = mx + c and as ax + by + c = 0, and find parallel lines.
  5. Draw a line from its equation and solve simultaneous equations graphically.
  6. Find the length and midpoint of a segment, the line through two points, and a perpendicular line (Extended).

Book exercises: 21.1 to 21.15 and Student assessment 1 (pp. 250–276). Exercises 21.13 to 21.15 are Extended content.

Coordinates

🔑 Key ideas

  • The origin is the point (0, 0), where the x-axis (across) and the y-axis (up) cross.
  • A point is written (x, y): x first (along), then y (up or down).
  • Going right or up is positive. Going left or down is negative.
−4−3−2−11234−4−3−2−11234xyA (3, 2)B (3, −3)C (−4, −3)D (−4, 3)
Four points in the four quadrants. A is 3 right and 2 up. B is 3 right and 3 down. C is 4 left and 3 down. D is 4 left and 3 up.

💡 “Along the corridor, then up the stairs”: always the x-coordinate first.

📘 Example 1 · P(−6, 4), Q(6, 4), R(8, −2). Find S so that PQRS is a parallelogram, then its diagonals' crossing point and area

  1. In a parallelogram PQ and SR are equal and parallel. PQ goes 12 across and 0 up.
  2. So S is 12 to the left of R: S = (8 − 12, −2) = (−4, −2).
  3. The diagonals cross at the midpoint of PR: ((−6 + 8) ÷ 2, (4 + (−2)) ÷ 2) = (1, 1).
  4. Check with QS: ((6 + (−4)) ÷ 2, (4 + (−2)) ÷ 2) = (1, 1). Same point. ✔
  5. Area = base × perpendicular height = PQ × (4 − (−2)) = 12 × 6 = 72 square units.

Reading scales

🔑 The recipe for any scale

  1. Take two labelled marks, e.g. 0 and 2.
  2. Count the small gaps between them (here 10).
  3. Value of one gap = (2 − 0) ÷ 10 = 0.2.
  4. Count gaps from a labelled mark to your point and multiply.
0 1 2 F = 1.2 each small gap = 0.2
Ten gaps between 0 and 2, so one gap is 0.2. F is 6 gaps along: 6 × 0.2 = 1.2.

📘 Example 2 · A number line from 4 to 7 has 6 equal gaps. Point K is 3 gaps from 4

  1. One gap = (7 − 4) ÷ 6 = 0.5.
  2. K is 3 gaps from 4: 3 × 0.5 = 1.5.
  3. K = 4 + 1.5 = 5.5.

✏️ Try it

  1. Write the coordinates of the point 5 to the left of the origin and 2 up.
  2. A(1, 1), B(5, 1), C(5, 4) are three corners of a rectangle. Find D and the area.
  3. P(2, 1), Q(6, 1), R(8, 4). Find S so that PQRS is a parallelogram.
Answers

1. (−5, 2) · 2. D = (1, 4); area = 4 × 3 = 12 · 3. SR must equal PQ (4 across), so S = (8 − 4, 4) = (4, 4)

Next: gradient →

The gradient of a straight line

🔑 Key ideas

  • The gradient is the steepness (slope) of a line. It is the same everywhere on a straight line.
  • Gradient = .
  • From two points (x₁, y₁) and (x₂, y₂): gradient = .
  • It does not matter which point you call point 1, as long as you use the same order on top and bottom.
−3−2−1123−4−3−2−11234xyA (2, 3)B (−1, −3)run = 3rise = 6
A(2, 3) and B(−1, −3). Going from B to A you move 3 across (run) and 6 up (rise). Gradient = 6 ÷ 3 = 2.

Reading the slope

positive rises to the right negative falls to the right zero horizontal infinite vertical
Four kinds of slope. Steeper means a bigger number (ignoring the sign).
LineRiseRunGradient
Rises to the rightup (+)right (+)positive
Falls to the rightdown (−)right (+)negative
Horizontal0any0
Verticalany0infinite (cannot divide by 0)

📘 Example 3 · Gradient of the line through (−4, 3) and (8, −3)

  1. Point 1 = (−4, 3) and point 2 = (8, −3).
  2. Rise: y₂ − y₁ = −3 − 3 = −6.
  3. Run: x₂ − x₁ = 8 − (−4) = 12.
  4. Gradient = −6 ÷ 12 = −½.
  5. Check by swapping the points: (3 − (−3)) ÷ (−4 − 8) = 6 ÷ (−12) = −½. ✔ Falling line, negative gradient. ✔

📘 Example 4 · Gradient of the line through (1, 2) and (4, 11)

  1. Rise: 11 − 2 = 9.
  2. Run: 4 − 1 = 3.
  3. Gradient = 9 ÷ 3 = 3.

📘 Example 5 · Horizontal and vertical lines

  1. Horizontal line through (−4, −1) and (4, −1): rise = −1 − (−1) = 0, run = 8, gradient = 0 ÷ 8 = 0.
  2. Vertical line through (3, −4) and (3, 4): rise = 8, run = 3 − 3 = 0, so the gradient is infinite (undefined).

✏️ Try it

  1. Find the gradient of the line through (1, 3) and (4, 9).
  2. Find the gradient of the line through (−2, 5) and (2, 1).
  3. What is the gradient of the line through (3, −1) and (3, 6)?
Answers

1. (9 − 3) ÷ (4 − 1) = 6 ÷ 3 = 2 · 2. (1 − 5) ÷ (2 − (−2)) = −4 ÷ 4 = −1 · 3. The run is 3 − 3 = 0, so the line is vertical and the gradient is infinite (undefined)

Next: the equation of a line →

The equation of a straight line

🔑 Key ideas

  • Every point on a line obeys the same rule linking x and y. That rule is the equation.
  • Horizontal line: y = number (e.g. y = 4). Vertical line: x = number (e.g. x = 7).
  • A line through the origin: y = mx.
  • Any other line: y = mx + c, where m = gradient and c = y-intercept (where it crosses the y-axis).
  • Other form: ax + by + c = 0 with a, b and c whole numbers.
−3−2−1123−4−3−2−11234xyc = 112
y = 2x + 1. It crosses the y-axis at 1 (that is c). Each step of 1 across goes 2 up (that is m = 2).

📘 Example 6 · Find the equation of the line through (−3, −2), (0, 1) and (3, 4)

  1. Gradient from (−3, −2) and (3, 4): (4 − (−2)) ÷ (3 − (−3)) = 6 ÷ 6 = 1.
  2. The line passes through (0, 1), so it meets the y-axis at 1: c = 1.
  3. Put m = 1 and c = 1 into y = mx + c: y = x + 1.
  4. Check with (3, 4): 3 + 1 = 4. ✔

Rearranging into y = mx + c

any equatione.g. 2y = 6x − 4 get y on its owndivide every term by 2 y = 3x − 2m = 3, c = −2 Divide EVERY term, not just one.
Get y alone on the left. Then the number in front of x is m and the lone number is c.

📘 Example 7 · Gradient and y-intercept of 2y = 6x − 4

  1. Divide every term by 2: y = 3x − 2.
  2. Compare with y = mx + c: m = 3 and c = −2.

📘 Example 8 · Gradient and y-intercept of 3x + 2y − 4 = 0

  1. Move the x term and the number to the right: 2y = −3x + 4.
  2. Divide every term by 2: y = −x + 2.
  3. m = − and c = 2.

📘 Example 9 · Write y = x + 1 as ax + by + c = 0 with whole numbers

  1. Multiply every term by 3 to clear the fraction: 3y = x + 3.
  2. Move everything to one side: 0 = x − 3y + 3.
  3. x − 3y + 3 = 0. Check (0, 1): 0 − 3 + 3 = 0. ✔

Parallel lines

🔑 Parallel lines have the same gradient

  • y = 4x − 1 and y = 4x + 6 are parallel: both have m = 4. Only c changes.
  • Always rearrange to y = mx + c before comparing.

📘 Example 10 · Line parallel to y = −3x + 1 through (−2, 4)

  1. Parallel, so the same gradient: y = −3x + c.
  2. Put in the point (−2, 4): 4 = −3 × (−2) + c = 6 + c.
  3. c = 4 − 6 = −2.
  4. y = −3x − 2.

📘 Example 11 · Is 2y = −x + 12 parallel to y = −x + 6?

  1. Divide by 2: y = −½x + 6.
  2. Its gradient is −½, but y = −x + 6 has gradient −1.
  3. The gradients differ, so not parallel.

✏️ Try it

  1. Find m and c for 2y = 8x − 6.
  2. Find the line parallel to y = 2x + 5 that passes through (1, 0).
  3. Write y = x − 1 in the form ax + by + c = 0 with whole numbers.
Answers

1. y = 4x − 3, so m = 4 and c = −3 · 2. y = 2x + c with 0 = 2 + c, so c = −2: y = 2x − 2 · 3. Multiply by 3: 3y = 2x − 3, so 2x − 3y − 3 = 0

Next: drawing and solving →

Drawing straight-line graphs

🔑 Plot a line in three steps

  1. Rearrange to y = … if needed.
  2. Choose three x-values (e.g. 0, 2, 4) and work out y for each. Three points catch mistakes: they must be in a straight line.
  3. Plot the points and draw one ruled line through them, extended past the points.
−3−2−1123−4−3−2−11234xy(0, −4)(2, 0)(3, 2)
y = 2x − 4 through (0, −4), (2, 0) and (3, 2). The point where y = 0 is where the line crosses the x-axis.

📘 Example 12 · Draw y = 2x − 4

  1. x = 0: y = 2 × 0 − 4 = −4. Point (0, −4).
  2. x = 2: y = 2 × 2 − 4 = 0. Point (2, 0).
  3. x = 3: y = 2 × 3 − 4 = 2. Point (3, 2).
  4. Plot the three points and join them with a ruler.

📘 Example 13 · Draw 3x + 2y = 6 (quick method: the intercepts)

  1. Cover the y term: x = 0 gives 2y = 6, so y = 3. Point (0, 3).
  2. Put y = 0: 3x = 6, so x = 2. Point (2, 0).
  3. Check a third point, x = 4: 12 + 2y = 6, so y = −3. Point (4, −3).
  4. Join the points.

Solving simultaneous equations graphically

🔑 Key ideas

  • Each equation is a line. A point on both lines satisfies both equations.
  • So the crossing point of the two lines is the solution.
  • Check by putting x and y into both original equations.
−112345678−1123456xy(3, 2)x + y = 5x − y = 1
x + y = 5 and x − y = 1 cross at (3, 2), so x = 3 and y = 2.

📘 Example 14 · Solve x + y = 5 and x − y = 1 graphically, then by algebra

  1. x + y = 5 passes through (0, 5) and (5, 0). Draw it.
  2. x − y = 1 passes through (1, 0) and (0, −1). Draw it.
  3. Read the crossing point: (3, 2), so x = 3, y = 2.
  4. Algebra check: add the equations: 2x = 6, so x = 3, then y = 5 − 3 = 2. ✔
  5. Both equations: 3 + 2 = 5 ✔ and 3 − 2 = 1 ✔.

When do two lines not cross once?

GradientsInterceptsWhat you seeSolutions
Differentanycross at one pointexactly one
Samedifferentparallel linesnone (e.g. y − 3x = 1 and y = 3x − 3)
Samesamethe same lineinfinitely many (e.g. 2x + y = 4 and 4x + 2y = 8)

✏️ Try it

  1. Make a table of three points for y = 2x − 4 using x = 0, 2, 4.
  2. Solve x + y = 7 and x − y = 3 (graph or algebra).
  3. Explain why y = 2x + 1 and y = 2x − 3 have no solution.
Answers

1. (0, −4), (2, 0), (4, 4) · 2. Adding gives 2x = 10, so x = 5 and y = 2 · 3. Both have gradient 2 but different intercepts, so the lines are parallel and never cross

Next: length, midpoint, perpendicular →

Length and midpoint of a line segment Extended

🔑 Two formulas

  • Midpoint of (x₁, y₁) and (x₂, y₂) = (, ): the mean of each coordinate.
  • Length = √((x₂ − x₁)² + (y₂ − y₁)²). It is just Pythagoras on the run and the rise.
1234567812345678910xyA (1, 2)B (7, 10)M (4, 6)across 6up 8length 10
A(1, 2) and B(7, 10): 6 across and 8 up make a right-angled triangle with hypotenuse 10. The midpoint is M(4, 6).

📘 Example 15 · Length and midpoint for (1, 2) and (7, 10)

  1. Run = 7 − 1 = 6 and rise = 10 − 2 = 8.
  2. Length = √(6² + 8²) = √(36 + 64) = √100 = 10.
  3. Midpoint = ((1 + 7) ÷ 2, (2 + 10) ÷ 2) = (4, 6).

📘 Example 16 · Length and midpoint for (5, 6) and (1, 2)

  1. Run = 1 − 5 = −4 and rise = 2 − 6 = −4 (squares remove the minus signs).
  2. Length = √((−4)² + (−4)²) = √32 = 4√2 ≈ 5.66.
  3. Midpoint = ((5 + 1) ÷ 2, (6 + 2) ÷ 2) = (3, 4).

The line through two points Extended

1. Gradient m = (y₂ − y₁) ÷ (x₂ − x₁) 2. Write y = mx + c 3. Find c put in one point 4. Check try the other point Same method for every pair of points.
Four steps for the line through two points.

📘 Example 17 · Equation of the line through (1, 1) and (4, 7)

  1. m = (7 − 1) ÷ (4 − 1) = 6 ÷ 3 = 2.
  2. Write y = 2x + c.
  3. Put in (1, 1): 1 = 2 × 1 + c, so c = −1.
  4. y = 2x − 1.
  5. Check (4, 7): 2 × 4 − 1 = 7. ✔

📘 Example 18 · Equation of the line through (3, −4) and (10, −18)

  1. m = (−18 − (−4)) ÷ (10 − 3) = −14 ÷ 7 = −2.
  2. Write y = −2x + c.
  3. Put in (3, −4): −4 = −2 × 3 + c = −6 + c, so c = 2.
  4. y = −2x + 2. Check (10, −18): −20 + 2 = −18. ✔

Perpendicular lines Extended

🔑 Key ideas

  • Two lines at a right angle are perpendicular.
  • Their gradients multiply to −1: m₁ × m₂ = −1.
  • To get the perpendicular gradient: flip the fraction and change the sign.
−4−3−2−11234−4−3−2−11234xym = 2m = −½
y = 2x and y = −½x cross at a right angle. 2 × (−½) = −1.
Gradient mPerpendicular gradientCheck m₁ × m₂
2−½−1 ✔
−3⅓−1 ✔
⅔−−1 ✔
0 (horizontal)vertical lineno number

📘 Example 19 · Line perpendicular to the line through (2, 6) and (6, −2), passing through (6, −2)

  1. Gradient of the first line = (−2 − 6) ÷ (6 − 2) = −8 ÷ 4 = −2.
  2. Perpendicular gradient: flip −2 (that is −2/1) to 1/2 and change the sign: ½. Check: −2 × ½ = −1. ✔
  3. Write y = ½x + c and put in (6, −2): −2 = 3 + c, so c = −5.
  4. y = ½x − 5.

🧪 Try it: line explorer

Point 1

Point 2

Solid line: through your two points. Dashed: the rise and run. Faint dashed line: the perpendicular through the midpoint M.

    ✏️ Try it

    1. Find the length and midpoint for (2, 1) and (10, 7).
    2. Find the equation of the line through (0, −4) and (3, −1).
    3. Find the line perpendicular to y = 3x + 1 that passes through (3, 2).
    Answers

    1. Run 8, rise 6: √(64 + 36) = √100 = 10; midpoint (6, 4) · 2. m = 3 ÷ 3 = 1, c = −4: y = x − 4 · 3. Perpendicular gradient −⅓. 2 = −⅓ × 3 + c = −1 + c, so c = 3: y = −⅓x + 3

    Next: summary and quiz →

    Chapter summary

    • Coordinates are (x, y): along first, then up. Scale value = (difference between labelled marks) ÷ (number of gaps).
    • Gradient = rise ÷ run = (y₂ − y₁) ÷ (x₂ − x₁). Horizontal: 0. Vertical: infinite.
    • y = mx + c: m is the gradient, c the y-intercept. Rearrange (divide every term) to read them.
    • Parallel lines have equal gradients. Perpendicular gradients multiply to −1.
    • Draw a line from three points. The crossing point of two lines solves their simultaneous equations.
    • Extended: midpoint = mean of the coordinates. Length = √(run² + rise²). Line through two points: find m, then c.

    📄 Practice questions

    The book's Exercises 21.1 to 21.15 and Student assessment 1 are in the printable assignment for this chapter.

    Mini-quiz

    1. What is the gradient of the line through (1, 2) and (3, 8)?
    2. In y = 5x − 7, what is the y-intercept?
    3. What is the gradient of the horizontal line y = 4?
    4. Which line is parallel to y = 3x + 1?
    5. What is the gradient of the line 2y = 6x − 4?
    6. A line has gradient 2. What is the gradient of a line perpendicular to it?
    7. What is the midpoint of the line segment from (2, 3) to (8, 7)?
    8. How long is the line segment from (0, 0) to (6, 8)?
    9. The lines x + y = 6 and x − y = 2 are drawn. Where do they cross?
    10. Which is y = ½x + 3 written in the form ax + by + c = 0?
    11. Which line has gradient −3 and passes through (0, 1)?
    12. Which point lies on the line y = 2x − 1?

    Source: Cambridge IGCSE Mathematics Core and Extended (4th edition, Pimentel and Wall), Chapter 21 (Straight-line graphs). Explanations, the Try it answers, the tool and the quiz are Guru Jazzy's own. This page is not made or endorsed by Cambridge or Hodder Education.