Given two points or a point and a gradient, how do we find the equation of the straight line through them?
Find the gradient of a line through two points and determine the equation of a straight line in the form y = mx + c
A focused answer to the N(A)-Level Mathematics outcome on the equation of a line. Finding gradient from two points, using a point to find the intercept, and writing the equation as y = mx + c.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
What this dot point is asking
SEAB wants you to find the gradient of a line joining two points and to work out the full equation of a straight line, written as , from either two points or a point and a gradient. This builds directly on linear graphs and is the core skill of coordinate geometry.
The answer
The gradient between two points
The gradient measures steepness: how much changes for each unit of . For two points and :
Keep the same order top and bottom. For and , the gradient is .
The equation of a straight line
Every non-vertical straight line has the form:
where is the gradient and is the -intercept. To find the equation you need the value of both and .
Finding the equation from two points
- Find the gradient from the two points.
- Write with the known gradient.
- Substitute one of the points to find .
- Write the complete equation.
Finding the equation from a point and a gradient
If the gradient is already known, skip straight to writing , then substitute the given point to find . This is quicker because step 1 is done for you.
Horizontal and vertical lines
Two special cases are worth knowing. A horizontal line has gradient , so its equation is simply (for example ). A vertical line has an undefined gradient and is written as (for example ); it cannot be put in the form because never changes along it.
Checking the equation
Substitute the other point (or the given point) back into your equation. If both sides match, the line really does pass through that point and the equation is correct. This single check catches most arithmetic and sign slips, so it is always worth the few seconds it takes.
Examples in context
Example 1. A line of best fit. In statistics, a scatter graph's line of best fit is a straight line whose equation can be found by reading off two clear points on it and using . The gradient then describes the rate of change in the data, linking coordinate geometry to statistics.
Example 2. Parallel lines. Two lines are parallel when they share the same gradient. So the line through parallel to also has gradient , giving once the new intercept is found from the point. Recognising equal gradients saves recalculating the slope.
Try this
- Cue. Find the gradient through and . Compute .
- Cue. A line has gradient through . Then , so and .
- Cue. Find the equation through and . Gradient , intercept , so .
Exam-style practice questions
Practice questions written in the style of SEAB exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.
Original4 marksA straight line passes through the points and . Find the equation of the line in the form .Show worked answer β
First find the gradient: .
So . Substitute one point, say : , so .
The equation is .
What markers reward: the correct gradient, substituting a known point to find , and the final equation in the requested form. A quick check with the second point () confirms the line passes through both.
Original3 marksA line has gradient and passes through the point . Find its equation in the form .Show worked answer β
The gradient is given, so .
Substitute the point : , so , giving .
The equation is .
What markers reward: using the given gradient directly, substituting the point correctly (watching the sign of ), and the final equation. The common slip is mishandling the negative gradient when substituting.
Related dot points
- Plot and draw graphs of linear functions y = mx + c, and interpret the gradient and y-intercept
A focused answer to the N(A)-Level Mathematics outcome on linear graphs. Plotting y = mx + c, finding gradient from two points, the meaning of the y-intercept, and reading values from a line.
- Calculate the length of a line segment using the distance formula and find the midpoint of a line segment
A focused answer to the N(A)-Level Mathematics outcome on length and midpoint. The distance formula from Pythagoras, the midpoint formula, and applying both to points on a grid.
- Solve a pair of simultaneous linear equations in two unknowns by elimination and by substitution, and form them from word problems
A focused answer to the N(A)-Level Mathematics outcome on simultaneous equations. The elimination and substitution methods, checking both equations, and forming a pair from a word problem.
- Represent a vector as a column vector, add and subtract vectors, and multiply a vector by a scalar
A focused answer to the N(A)-Level Mathematics outcome on vectors. Column vector notation, adding and subtracting vectors, scalar multiples, and finding the magnitude of a vector.