Rise over run
The gradient (or slope) of a straight line tells you how steep it is. It is the amount the line rises for every one unit it moves across, written as rise over run.
- Gradient
- The steepness of a line: \(\text{gradient} = \dfrac{\text{rise}}{\text{run}} = \dfrac{\text{change in } y}{\text{change in } x}\). A bigger number means a steeper line.
"Rise" is how far the line goes up, and "run" is how far it goes across to the right. A line that goes up \(2\) for every \(1\) across has gradient \(\tfrac{2}{1} = 2\).
Positive, negative and zero
The sign of the gradient tells you the direction of the tilt, reading the line from left to right.
| Gradient | What the line does |
|---|---|
| Positive | Slopes uphill from left to right. |
| Negative | Slopes downhill from left to right. |
| Zero | Flat, a horizontal line (no rise). |
A vertical line is a special case: its run is \(0\), and dividing by zero is undefined, so a vertical line has no gradient at all.
From two points
If you know two points on the line, \((x_1, y_1)\) and \((x_2, y_2)\), the rise is the change in \(y\) and the run is the change in \(x\):
Keep the points in the same order
Whichever point you use first for the top of the fraction, use first for the bottom too. Subtracting \(y\)-values as "second minus first" but \(x\)-values as "first minus second" flips the sign and gives the wrong slope. Consistency is what makes the answer, and your reasoning, correct.
Working an example
Label the two points, find the change in \(y\) and the change in \(x\), then divide.
Find the gradient of the line through \((1, 2)\) and \((4, 8)\).
Check yourself
1. Find the gradient of the line through \((2, 3)\) and \((6, 11)\) +
Rise: \(11 - 3 = 8\). Run: \(6 - 2 = 4\). Gradient: \(\dfrac{8}{4} = \mathbf{2}\) (positive, so uphill).
2. Find the gradient of the line through \((1, 5)\) and \((4, -1)\) +
Rise: \(-1 - 5 = -6\). Run: \(4 - 1 = 3\). Gradient: \(\dfrac{-6}{3} = \mathbf{-2}\) (negative, so downhill).
3. Find the gradient of the line through \((0, 4)\) and \((5, 4)\) +
Rise: \(4 - 4 = 0\). Run: \(5 - 0 = 5\). Gradient: \(\dfrac{0}{5} = \mathbf{0}\). A zero gradient means the line is horizontal.
Part of the Standard Maths library. Spotted an error or want a topic added? That feedback makes the notes better.