Equation of a Line Through Two Points
This interactive tool helps you find the equation of the straight line through two points on a coordinate grid. Drag the points to explore visually and read off the gradient, y-intercept and equation, then switch to a written, step-by-step calculation.
To explore the equation the other way round β building a line from a chosen gradient and intercept β try Equation of a Straight Line.
How to Use
Tab Navigation
Switch between the activities using the tabs:
- Two points: Drag points A and B on the grid and reveal the gradient, y-intercept and equation.
- Calculate: See the question written out, then draw the worked solution with the pen.
- π¨ Settings: Change the grid style and the line colour.
Shared Controls
One control sits below both tabs:
- New problem generates a fresh pair of points.
π Two points
The Two points tab is for exploring on the grid.
π§ How to Use the Tool
Drag points A and B to change the line. Click Gradient (m), Y-intercept (c) and Equation to reveal each result and check your working.
Two visual aids show where the numbers come from:
- Triangle draws the gradient triangle between A and B. Choose Triangle only, or Triangle + measures to label the run and rise. The triangle is always drawn left-to-right, so the run is positive and the sign of the gradient shows in the rise.
- Show y-intercept highlights the point (0, c) where the line crosses the y-axis.
The gradient is the rise over the run between the two points:
m = (yβ β yβ) Γ· (xβ β xβ)
Because the points sit on whole-number grid corners, the gradient and y-intercept are shown as exact fractions (for example 2/3) rather than rounded decimals.
βοΈ Calculate
The Calculate tab writes the working by hand, using the current points.
π§ How to Use the Tool
The question appears first β for example βFind the equation of the line through A(1, 1) and B(4, 3)β. Work it out yourself, then click Next step to reveal the working one line at a time β or Show all for the whole solution: the gradient m is found as rise over run, one point is substituted into y = mx + c to find the intercept (c), and the equation is written out.
Press New problem for another question.