Sub topic 3
Reviewing Slope
Assume you can plot points on a coordinate plane, simplify fractions, and solve basic linear equations. This chapter reviews slope so you can use it to study parallel and perpendicular lines later.
Slope as a rate of change
The slope of a line measures how much the vertical coordinate changes when the horizontal coordinate changes. In coordinate language:
- The change in the vertical coordinate is called the change in
y. - The change in the horizontal coordinate is called the change in
x. - Slope is the ratio of these changes.
The usual symbol for slope is m.
For two points (x₁, y₁) and (x₂, y₂):
m = (y₂ - y₁) / (x₂ - x₁)
The order must be consistent. If you subtract y₂ - y₁, also subtract x₂ - x₁.
Reading the sign of a slope
The sign tells you the direction of the line as you move from left to right.
| Slope | Meaning | Direction from left to right |
|---|---|---|
| Positive | `y` increases as `x` increases | Rises |
| Negative | `y` decreases as `x` increases | Falls |
| Zero | `y` does not change | Horizontal |
| Undefined | `x` does not change | Vertical |
For example, a slope of 3/2 means the line rises 3 units for every 2 units it moves right. A slope of -3/2 means it falls 3 units for every 2 units it moves right.
Computing slope from two points
Consider the points (2, 3) and (6, 11). Let the first point be (x₁, y₁) and the second be (x₂, y₂):
m = (11 - 3) / (6 - 2) = 8 / 4 = 2
The slope is 2. The line rises 2 units for every 1 unit to the right.
Now consider (−1, 5) and (3, −7):
m = (−7 - 5) / (3 - (−1)) = −12 / 4 = −3
The slope is −3, so the line falls 3 units for every 1 unit to the right.
A negative coordinate requires careful use of parentheses. In the second calculation, subtracting −1 means adding 1.
Computing slope from an equation
In slope-intercept form, a line is written as:
y = mx + b
Here, m is the slope and b is the y-intercept, the point where the line crosses the y-axis.
For y = 4x - 7, the slope is 4.
For y = -1/3x + 2, the slope is -1/3.
Some equations need rearranging first. For example:
2x + y = 9
Solve for y:
y = -2x + 9
Therefore, the slope is -2.
Common errors
- Reversing only one subtraction:
(y₂ - y₁) / (x₁ - x₂)changes the sign incorrectly. - Using the intercept as the slope. In
y = mx + b, the coefficient ofxis the slope. - Treating a vertical line like an ordinary fraction. Its change in
xis zero, and division by zero is undefined. - Assuming a steeper-looking line always has the greater slope. The coordinate scale on a graph can distort visual appearance, so calculate the slope when precision matters.
Python can calculate slopes exactly with fractions instead of decimal approximations.
from fractions import Fraction
def slope(point1, point2):
x1, y1 = point1
x2, y2 = point2
if x1 == x2:
return None # The line is vertical.
return Fraction(y2 - y1, x2 - x1)
print(slope((2, 3), (6, 11))) # 2
print(slope((-1, 5), (3, -7))) # -3
print(slope((0, 4), (5, 4))) # 0
print(slope((2, 1), (2, 8))) # NoneExercise
Find the slope of the line through (-4, 7) and (2, -5). State whether the line rises or falls from left to right.
Show answer
m = (-5 - 7) / (2 - (-4)) = -12 / 6 = -2. The line falls from left to right.