how to find the slope of a line
To find the slope of a line, you measure how much it goes up or down compared to how much it goes left or right, written as “rise over run.”
What “slope” means
- Slope tells you how steep a line is and whether it’s going up or down as you move to the right.
- Positive slope: line goes up as you move right.
- Negative slope: line goes down as you move right.
- Zero slope: perfectly horizontal line.
- Undefined slope: perfectly vertical line.
Main formula for slope
If you know two points on the line, say
(x1,y1)(x_1,y_1)(x1,y1) and (x2,y2)(x_2,y_2)(x2,y2), then the slope mmm
is:
m=y2−y1x2−x1m=\frac{y_2-y_1}{x_2-x_1}m=x2−x1y2−y1
You can remember this as:
- rise = change in y = y2−y1y_2-y_1y2−y1
- run = change in x = x2−x1x_2-x_1x2−x1
- slope = rise ÷ run.
Step‑by‑step: using two points
Suppose your line goes through the points (2,5)(2,5)(2,5) and (9,19)(9,19)(9,19).
- Label the points
- (x1,y1)=(2,5)(x_1,y_1)=(2,5)(x1,y1)=(2,5)
- (x2,y2)=(9,19)(x_2,y_2)=(9,19)(x2,y2)=(9,19)
- Find the change in y (rise)
- y2−y1=19−5=14y_2-y_1=19-5=14y2−y1=19−5=14
- Find the change in x (run)
- x2−x1=9−2=7x_2-x_1=9-2=7x2−x1=9−2=7
- Divide rise by run
- m=147=2m=\dfrac{14}{7}=2m=714=2
So the slope of the line through those two points is 222. That means every time x increases by 1, y increases by 2.
Finding slope from a graph (rise over run)
If you have a graph instead of coordinates:
- Pick any two clear points on the line that hit grid intersections.
- From the first point, count how far you go up or down to get to the second point (this is the rise).
- Then count how far you go right to get to the second point (this is the run).
- Slope = rise ÷ run.
Example:
- From point A to point B, suppose you go up 3 units and right 2 units.
- Then slope m=32m=\dfrac{3}{2}m=23.
If you go down instead of up, the rise is negative. For example, down 4 and right 1 gives slope m=−41=−4m=\dfrac{-4}{1}=-4m=1−4=−4.
Special cases to know
- Horizontal line (flat):
- Same y‑value for every point, like (−3,3)(−3,3)(−3,3) and (2,3)(2,3)(2,3).
- y2−y1=3−3=0y_2-y_1=3-3=0y2−y1=3−3=0, so m=0/(x2−x1)=0m=0/(x_2-x_1)=0m=0/(x2−x1)=0.
- Slope = 0.
- Vertical line (straight up and down):
- Same x‑value for every point, like (4,1)(4,1)(4,1) and (4,7)(4,7)(4,7).
- x2−x1=4−4=0x_2-x_1=4-4=0x2−x1=4−4=0, so you’d divide by 0, which is not allowed.
- Slope is “undefined.”
Quick reference table (HTML)
Here’s an HTML table summarizing slope situations:
html
<table>
<thead>
<tr>
<th>Type of line</th>
<th>Example points</th>
<th>Calculation</th>
<th>Slope value</th>
<th>What it looks like</th>
</tr>
</thead>
<tbody>
<tr>
<td>Positive slope</td>
<td>(2, 5) and (9, 19)</td>
<td>(19 - 5) / (9 - 2) = 14 / 7</td>
<td>m = 2</td>
<td>Rises as you move right</td>
</tr>
<tr>
<td>Negative slope</td>
<td>(1, 4) and (3, 0)</td>
<td>(0 - 4) / (3 - 1) = -4 / 2</td>
<td>m = -2</td>
<td>Falls as you move right</td>
</tr>
<tr>
<td>Zero slope</td>
<td>(-3, 3) and (2, 3)</td>
<td>(3 - 3) / (2 - (-3)) = 0 / 5</td>
<td>m = 0</td>
<td>Perfectly horizontal</td>
</tr>
<tr>
<td>Undefined slope</td>
<td>(4, 1) and (4, 7)</td>
<td>(7 - 1) / (4 - 4) = 6 / 0</td>
<td>Undefined</td>
<td>Perfectly vertical</td>
</tr>
</tbody>
</table>
Tiny story to remember it
Imagine walking up a hill:
- Every step forward is your run.
- Every step up is your rise.
- A steep hiking trail has a big rise for a small run → large slope.
- A flat sidewalk has almost no rise → slope near 0.
- A ladder standing straight up would be like a vertical line → “infinite” steepness → undefined slope.
TL;DR
- Use the formula m=y2−y1x2−x1m=\dfrac{y_2-y_1}{x_2-x_1}m=x2−x1y2−y1.
- Think of slope as “how much y changes when x goes over by 1.”
- Remember: rise over run, positive goes up, negative goes down, 0 is flat, vertical is undefined.