The slope formula
Slope measures how steep a line is — the rise (change in y) over the run (change in x) between two points:
m = (y₂ − y₁) ÷ (x₂ − x₁)
For (1, 2) and (4, 8): m = (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2. The line rises 2 units for every 1 unit it moves right.
Building the equation
Once you have the slope, the line in slope-intercept form is y = mx + b, where b is the y-intercept. Solve for b with either point:
b = y − m · x
With slope 2 through (1, 2): b = 2 − 2·1 = 0, giving y = 2x.
Special cases
- Zero slope: a horizontal line (y is constant).
- Undefined slope: a vertical line (x is constant) — the run is zero.
- Negative slope: the line falls from left to right.
Frequently asked questions
How do you find the slope between two points?
Divide the change in y by the change in x: slope = (y₂ − y₁) ÷ (x₂ − x₁), often remembered as "rise over run." For the points (1, 2) and (4, 8), the slope is (8 − 2) ÷ (4 − 1) = 6 ÷ 3 = 2.
What is the y-intercept?
The y-intercept is the y-value where the line crosses the y-axis (where x = 0). Once you have the slope m, find it with b = y − m·x using either point. With slope 2 through (1, 2), b = 2 − 2·1 = 0, so the line is y = 2x.
What does a negative or zero slope mean?
A positive slope rises from left to right, a negative slope falls. A slope of zero is a horizontal line. A vertical line has an undefined slope, because the run (change in x) is zero and you cannot divide by zero — the calculator flags this case.
How is the distance between the points found?
With the distance formula, which is the Pythagorean theorem applied to the horizontal and vertical gaps: distance = √((x₂ − x₁)² + (y₂ − y₁)²). For (1, 2) and (4, 8) that is √(9 + 36) = √45 ≈ 6.71.
Note: A vertical line (when x₂ equals x₁) has an undefined slope and is flagged as such. The angle is measured from the horizontal.