Short answerEvery straight line (except vertical ones) can be written y = mx + c. m is the gradient, how steep the line is: rise ÷ run. c is the y-intercept, where the line crosses the y-axis.

🧪 Try it in the free lab. In the free linear functions simulation you move the sliders for m and c and see how the line changes, then match lines to real situations.
Open the lab →
Gradient
m = (y₂ − y₁) ÷ (x₂ − x₁)
- Positive m: the line goes up from left to right.
- Negative m: it goes down.
- m = 0: a horizontal line, y = c.
- The bigger the size of m, the steeper the line.
Worked example: the equation from two points
Find the line through (1, 5) and (4, 11).
- m = (11 − 5) ÷ (4 − 1) = 6 ÷ 3 = 2.
- Substitute (1, 5) into y = 2x + c: 5 = 2 + c, so c = 3.
- The line is y = 2x + 3. Check with (4, 11): 2 × 4 + 3 = 11. ✓
A real example: a taxi fare
A taxi charges a fixed 1 000 FRW plus 600 FRW per kilometre. The cost y for x km is y = 600x + 1000. The gradient 600 is the price per km; the intercept 1 000 is the cost before moving. A 7 km trip costs 600 × 7 + 1000 = 5 200 FRW. In real life, the gradient is often a rate: price per item, speed, or pay per hour.
Parallel and perpendicular lines
- Parallel lines have the same gradient: y = 2x + 3 and y = 2x − 4.
- Perpendicular lines have gradients that multiply to −1: y = 2x + 3 and y = −½x + 1.
Drawing a line quickly
For y = −3x + 6: mark the intercept (0, 6), then from there go 1 across and 3 down, mark (1, 3), and draw the line. The line crosses the x-axis where y = 0: −3x + 6 = 0, so x = 2.
🧪 Linear functions and gradients · free, works on any phone, with graphs, questions and a lab report.
Start the lab →
Questions people ask
What is the gradient of a vertical line?
It is undefined. A vertical line has the equation x = a number.
Does every straight line pass through the origin?
No. Only those with c = 0, such as y = 4x, which show direct proportion.
Can m be a fraction?
Yes. y = ½x + 2 rises 1 unit for every 2 units across.
Practise this topic
Written by BIZIYAREMYE Donat, Experienced Physics and STEM Educator, Rwanda. Published 30 November 2026. Found a mistake? Write on WhatsApp 0788 804 242. More explainers · All Interactive Labs