The Equation of a Straight Line

Every straight line you can draw has the same tidy equation:

y = mx + c

Just two numbers fix the whole line. The number m is the gradient — how steeply the line tilts — and c is the y-intercept — the height at which it crosses the y-axis. (The gradient is exactly the gradient you have already measured as rise over run.)

For a straight line written as y = mx + c:

Drive the line yourself

Pull the two sliders. Watch m tilt the line and c slide it up and down without changing its tilt.

Reading a line off its equation

Once a line is in this form, its two facts read straight off. For y = 2x + 3 the gradient is m = 2 and the y-intercept is c = 3, so the line climbs two units for every one across and crosses the axis at (0, 3). To find y at any x, substitute it in: at x = 4, y = 2(4) + 3 = 11.