Equation of a Straight Line
This interactive tool helps you explore the equation of a straight line in the form y = mx + c. Use the sliders to set the gradient m and the y-intercept (c), and watch how each one changes the line drawn on the coordinate grid.
The inverse task — finding the equation from two given points — has its own activity, Equation of a Line Through Two Points.
How to Use
Tab Navigation
Switch between the activities using the tabs:
- y = mx + c: Drag the sliders to set the gradient and y-intercept, reveal the equation, and show the gradient triangle or the y-intercept.
- 🎨 Settings: Change the grid style and the line colour.
📈 y = mx + c
The y = mx + c tab is for exploring how the two numbers in the equation shape the line.
🧭 How to Use the Tool
Drag the gradient (m) slider to make the line steeper or shallower, and the y-intercept (c) slider to slide it up and down. Click Equation to reveal the current equation, and press Randomize for a fresh line.
Two visual aids help connect the equation to the graph:
- Triangle draws a gradient triangle at the y-intercept. Choose Triangle only for the right-angled triangle, or Triangle + measures to label the run and rise. It is a unit triangle — the run is always 1, so the rise is exactly the gradient m.
- Show y-intercept highlights the point (0, c) where the line crosses the y-axis.
In the equation y = mx + c:
- m is the gradient — the rise for a run of 1. A larger m is steeper; a negative m slopes downhill.
- the y-intercept (c) — the value of y where the line crosses the y-axis, at (0, c).