Gradient of a Line Through Two Points
Find the gradient of a straight line from the coordinates of two of its points with the formula find an unknown coordinate from a given gradient, and use gradients to tell whether three points lie on one straight line.
Before you start
- In Secondary 1 you found the gradient of a straight line from a right-angled step between two of its points: You went from the left-hand point to the right-hand point, so a line that goes up from left to right has a positive gradient, and a line that goes down from left to right has a negative gradient. Any two points on the line give the same gradient.
- For example, from to the horizontal change is and the vertical change is , so the gradient is .
- In Secondary 2 you met the two special lines: a horizontal line has gradient , and a vertical line has no gradient: its gradient is undefined, because its horizontal change is .
The Gradient Formula
Two points with whole-number coordinates are easy to sketch. With negative coordinates, fractions or large numbers, a sketch is slow and a slip is easy. So we give the coordinates names and write the two changes as subtractions.
Call the two points and . Here is read " one": it is the -coordinate of the first point. Going from to , the -coordinate changes from to , so the horizontal change is . The -coordinate changes from to , so the vertical change is .
The gradient formula
The gradient of the line through the points and , where , is
Either point may be taken as , but the subtraction on the top and the subtraction at the bottom must start from the same point. The point you start from is the one whose coordinates are taken away: going from to , both subtractions take away 's coordinates.
If , the two points are one above the other: the line is vertical and its gradient is undefined. If , the line is horizontal and its gradient is .
Why may we start from either point? If we go from to instead, the top becomes and the bottom becomes . Both have changed sign, and a fraction whose top and bottom both change sign has the same value: .
The formula also takes care of the sign by itself. When the right-hand point is lower, the top and the bottom have opposite signs and the gradient comes out negative, as it should for a line that goes down from left to right.
Example 1: Using the formula
Find the gradient of the line through and .
Solution
Take as and as : , , , .
Subtracting is the same as adding , so the bottom is .
Check by starting from : the same.
Check with a sketch: from the step goes across and up, so the line goes up from left to right and the gradient is positive.
The gradient of the line through and is .
Example 2: Negative coordinates and a negative gradient
Find the gradient of the line through and .
Solution
Take as and as . Put each negative number in brackets as you substitute it.
Check by starting from :
Check the sign: is the left-hand point () and it is higher (), so the line goes down from left to right. A negative gradient is right.
The gradient of the line through and is .
An Unknown Coordinate from a Given Gradient
If the gradient is known and one coordinate of a point is not, substitute everything you know into the formula. This gives an equation with one unknown. Solve it, then check by working out the gradient with the value you found.
Example 3: An unknown y-coordinate
The line through and has gradient . Find the value of .
Solution
Take as and as .
Multiply both sides by : .
Add to both sides: .
Check: the line through and has gradient
Example 4: An unknown x-coordinate
The line through and has gradient . Find the value of .
Solution
Take as and as .
The unknown is at the bottom. Multiply both sides by to clear both fractions:
Expand: .
Add to both sides: , so .
Check: the line through and has gradient
Three Points on One Straight Line
Points that lie on one straight line are called collinear. Gradients give a quick test. Find the gradient of and the gradient of . If they are different, the path from to to bends at , so the points are not collinear.
If the gradients are equal, the two segments are equally steep and they share the point . A line with a given gradient through a given point is fixed, so and are parts of one line. The shared point matters: two segments with equal gradients and no point in common may lie on two different parallel lines.
Collinear points
Points , and are collinear (they lie on one straight line) when the gradient of is equal to the gradient of . The point is on both segments.
If the two gradients are different, the points are not collinear. (If and are both vertical, the three points have the same -coordinate and lie on one vertical line.)
Example 5: Collinear or not?
The points , , and are given. (a) Show that , and are collinear. (b) Determine whether , and are collinear.
Solution
(a) Gradient of
Gradient of
The gradients are equal and is on both and , so , and lie on one straight line.
(b) The gradient of is , as in (a). Gradient of
Since , the line bends at : is not on the line through and .
In this drawing one square on the -axis is units, but one square on the -axis is unit, so the line looks less steep than a gradient of . Read the numbers on the axes, not the squares.
(a) The gradients of and are both , so , and are collinear. (b) The gradients of and are and , so , and are not collinear.
In lesson 4.6 you will use this test, with the lengths of lesson 4.2, to solve problems about triangles and quadrilaterals drawn from coordinates.
Common Mistakes
- Subtracting in different orders. for the line through and goes from to on the top but from to at the bottom. Start both subtractions from the same point:
- Putting the -coordinates on top. The gradient is the vertical change over the horizontal change: the -coordinates go on top.
- Losing a minus sign. , not . Put each negative coordinate in brackets when you substitute it.
- Writing a division by . If , do not write a fraction: say that the line is vertical and its gradient is undefined.
- Testing three points with two segments that share no point. Compare the gradients of two segments that share a point, such as and : equal gradients alone do not put the points on one line.
Practice Questions
Work each question on paper before you open its solution. The questions get harder as you go.
Question 1
Find the gradient of the line through each pair of points. (a) and (b) and (c) and
ShowHide solution
(a)
(b)
(c)
(a) (b) (c)
Question 2
Find the gradient of the line through each pair of points, if it has one. (a) and (b) and (c) and (d) and
ShowHide solution
(a)
(b)
(c) Both points have -coordinate : the line is the horizontal line .
(d) , so the gradient is undefined: both points have -coordinate , and the line is the vertical line .
(a) (b) (c) (d) undefined: the line is vertical.
Question 3
Siti finds the gradient of the line through and like this: Explain her mistake and find the correct gradient.
ShowHide solution
On the top she went from to ( is 's -coordinate minus 's), but at the bottom she went from to ( is 's -coordinate minus 's). Both subtractions must start from the same point.
Starting from in both:
Check the sign: is to the right of and lower, so the line goes down from left to right and its gradient is negative.
She subtracted in different orders on the top and at the bottom. The gradient is .
Question 4
The line through and has gradient . Find the value of .
ShowHide solution
so .
Multiply both sides by : , so .
Check:
Question 5
The line through and has gradient . Find the value of .
ShowHide solution
, so .
Multiply both sides by :
Add and add to both sides: , so .
Check:
Question 6
Determine whether the points , and are collinear.
ShowHide solution
Gradient of
Gradient of
The gradients are equal and is on both segments.
The points , and are collinear.
Question 7
Determine whether the points , and are collinear.
ShowHide solution
Gradient of
Gradient of
(as decimals, and ), so the line bends at .
The points , and are not collinear.
Question 8
The points , and lie on one straight line. Find the value of .
ShowHide solution
Gradient of
The points are collinear, so the gradient of is also : .
Multiply both sides by : , so and .
Check: the gradient of is
Question 9
A side view of a walkway is drawn with axes in metres. Ramp 1 runs straight from to . After a flat landing, ramp 2 runs straight from to . A ramp for wheelchairs should have a gradient of at most . Which ramp meets this rule?
ShowHide solution
Gradient of ramp 1
Gradient of ramp 2
Ramp 1: , so it meets the rule. Ramp 2: , so it is too steep.
Ramp 1 meets the rule (gradient ); ramp 2 is too steep (gradient ).
Question 10
A plan of a park is drawn with axes in metres. Three lamp posts stand at , and . A gardener wants to hang a string of lights in a straight line from through to . Are the three lamp posts in one straight line?
ShowHide solution
Gradient of
Gradient of
The gradients are equal and is on both segments, so , and are collinear.
Yes: the gradients of and are both , so the three lamp posts are in one straight line.
Question 11
The line through and has gradient . Find the value of , and write down the coordinates of and .
ShowHide solution
Multiply both sides by :
Add and add to both sides: , so .
Then is and is . Check:
; and .
Key Points
- The gradient of the line through and is where .
- Either point may be taken as , but the top and the bottom must start from the same point.
- Put negative coordinates in brackets when you substitute them: .
- If , the line is vertical and has no gradient; if , the line is horizontal and its gradient is .
- An unknown coordinate: substitute into the formula with the given gradient, solve the equation, and check.
- Points , and are collinear when the gradient of equals the gradient of ; is on both segments.