How it works
Slope is how much y changes for each step in x — rise over run. With the slope you can write the line as y = mx + b.
Formula
m = (y₂ − y₁) ÷ (x₂ − x₁) · b = y₁ − m·x₁
Example
Through (1, 2) and (4, 8): m = 6 ÷ 3 = 2, b = 0, so y = 2x. The distance is about 6.7082.
Assumptions & limitations
- Results are rounded for display.
Frequently asked questions
What does a negative slope mean?
The line goes down as you move right.