Linear Functions
Slope of a Straight Line
Slope as rise over run, why it comes out the same whichever two points are used, and what its sign and size tell you.
What this page covers
- Compute the slope of a line from two points
- Explain why the order of the points does not matter
- Interpret the sign and magnitude of a slope
- Recognise the two special cases of zero and undefined slope
Rise over run
The rise is the vertical change, the run the horizontal one. Slope is their ratio, and it measures how steeply the line climbs per unit travelled sideways.
The source anchors it with a physical example: a run of 3000 mm against a rise of 200 mm, which is the ordinary engineering reading of a gradient.
Order does not matter
Reversing the two points negates both the numerator and the denominator, and the two sign changes cancel.
The source's check
For P(1, 4) and Q(5, 7):
What must not happen is mixing the orders: y2 - y1x1 - x2 gives -34, the wrong sign. Choose an order and use it in both the numerator and the denominator.
Two different pairs of points on the same line generate similar right triangles, and similar triangles have equal ratios of corresponding sides. So the slope is a property of the line, not of the points chosen.
Reading the sign and the size
| Slope | Direction | Appearance |
|---|---|---|
| m > 0 | Rises left to right | Uphill |
| m < 0 | Falls left to right | Downhill |
| m = 0 | Horizontal | y never changes |
| Undefined | Vertical | x never changes; run is zero |
| |m| large | Steep | A small run gives a large rise |
| |m| small | Shallow | A large run gives a small rise |
The source draws the positive and negative cases side by side and labels the negative one rise (negative), which is the right way to think of it: the rise is still measured upward, it simply comes out negative.
A horizontal line has slope 0, which is a perfectly good number. A vertical line has undefined slope, because the run is zero and the formula divides by zero. Calling a vertical slope 'infinite' is informal and misleading; the formula simply does not apply.
Worked examples
A negative slope — the source's case
Find the slope of the line through P(-1, 4) and Q(3, 2).
Negative, so the line falls. For every 2 units right, it drops 1.
3 - (-1) = 4, not 2. Subtracting a negative coordinate is where slope calculations most often go wrong.
A second source example
Through (4, -2) and (2, 5):
Steeply negative: a drop of 3.5 for every unit right.
Slope as a rate of change
Outside geometry, slope is almost always read as a rate: how fast one quantity changes with respect to another.
| Setting | Rise | Run | Slope means |
|---|---|---|---|
| A ramp | Height gained | Horizontal distance | Gradient |
| Distance against time | Distance | Time | Speed |
| Cost against quantity | Cost | Units made | Cost per unit |
| Extension against load | Extension | Load | Compliance |
Because the slope of a straight line is the same everywhere, a linear model asserts a constant rate. That is exactly the assumption a straight-line fit makes, and it is worth being conscious of it.
Common mistakes
| Mistake | Correct | Check |
|---|---|---|
| Run over rise | Rise over run | A steep line has a large slope |
| Mixing the order between numerator and denominator | Be consistent | The sign will be wrong |
| 3 - (-1) = 2 | = 4 | Bracket the substitution |
| Calling a vertical slope zero | It is undefined | The run is zero |
| Calling a horizontal slope undefined | It is zero | The rise is zero, the run is not |
| Assuming a curve has one slope | Only lines do | For a curve the slope varies from point to point |
Frequently asked questions
Does it matter which point I call the first?
No, provided the same choice is used top and bottom. The source shows both orders give 34 for the same pair of points, because two sign changes cancel.
What is the slope of a vertical line?
Undefined. The run is zero, so the formula divides by zero. This is not 'infinite slope'; it is a case the formula does not cover.
What does the number mean physically?
It is a rate of change: how much y moves per unit of x. A slope of 2003000 on a ramp means 200 mm of rise for every 3000 mm of run.
Can I use any two points on the line?
Yes, and that is what makes slope well defined. Similar triangles guarantee the ratio is the same wherever it is measured.
Source. Handwritten teaching notes, Week 5, pages 6-8.
This page is an original exposition prepared for the KEVOS® knowledge library. It restates, reorganises and verifies the mathematics of the supplied teaching notes; it is not a reproduction of them. Numerical values taken from the notes are identified as source examples and are not presented as engineering standards.
