Sub topic 4
Slope and Collinearity
Assume you can simplify fractions, solve linear equations, and use coordinates in the Cartesian plane. This chapter uses those skills to compare the steepness of lines and test whether points lie on one straight line.
What slope measures
The slope of a non-vertical line measures its change in y for each unit change in x:
slope = change in y / change in x
For two points A(x₁, y₁) and B(x₂, y₂),
m = (y₂ - y₁) / (x₂ - x₁)
The numerator is called the rise. The denominator is called the run. Use the same order for both differences.
For example, let A(2, 3) and B(6, 11).
m = (11 - 3) / (6 - 2) = 8 / 4 = 2
As x increases by 1, y increases by 2. The line rises from left to right.
| Slope | Meaning |
|---|---|
| Positive | The line rises from left to right |
| Negative | The line falls from left to right |
| Zero | The line is horizontal |
| Undefined | The line is vertical |
A vertical line has x₂ - x₁ = 0, so its slope is undefined. Do not describe its slope as zero.
Testing collinearity
Points are collinear if they lie on one straight line. To test three points, calculate the slope between two pairs.
For A(1, 2), B(4, 8), and C(7, 14):
mAB = (8 - 2) / (4 - 1) = 2
mBC = (14 - 8) / (7 - 4) = 2
The slopes match, so the three points are collinear.
If one pair forms a vertical line, compare x-coordinates instead. Points with the same x-coordinate lie on one vertical line.
A useful alternative is the area test. Three points are collinear exactly when the triangle they form has area zero:
x₁(y₂ - y₃) + x₂(y₃ - y₁) + x₃(y₁ - y₂) = 0
This avoids dividing by zero and can be faster when the coordinates are integers.
Common errors and CAT strategy
- Reverse both differences together, or reverse neither. Mixing the orders changes the sign.
- A negative slope does not mean a negative distance. Slope describes direction.
- Check whether a line is vertical before using the slope formula.
- For a line through two points, compute the slope first. Then use y - y₁ = m(x - x₁).
- For a midpoint or intersection question, do not calculate slopes unless the question asks about direction or perpendicularity.
- In multiple-choice questions, test the answer choices with the simplest slope comparison available.
def slope(point_a, point_b):
x1, y1 = point_a
x2, y2 = point_b
if x1 == x2:
return None # vertical line
return (y2 - y1) / (x2 - x1)
def are_collinear(a, b, c):
# Cross-multiplication avoids division and handles vertical lines.
x1, y1 = a
x2, y2 = b
x3, y3 = c
return (y2 - y1) * (x3 - x1) == (y3 - y1) * (x2 - x1)
print(slope((2, 3), (6, 11)))
print(are_collinear((1, 2), (4, 8), (7, 14)))Exercise
Are the points (2, 5), (2, -1), and (2, 9) collinear? Explain without using the slope formula.
Show answer
Yes. All three points have x = 2, so they lie on the same vertical line.