Slope Calculator
Calculate the slope of the line through two points (x₁,y₁) and (x₂,y₂), along with its equation and the angle of inclination relative to the X axis.
How is it calculated?
Slope: m = (y₂ − y₁) ÷ (x₂ − x₁). Y-intercept: b = y₁ − m × x₁, giving the line's equation y = mx + b. Angle of inclination: arctangent of the slope, in degrees. If x₁ = x₂, the line is vertical and the slope is undefined (division by 0).
Examples
Line through (1, 2) and (4, 8)
Slope = 2, equation y = 2x, angle ≈ 63.43°.
Horizontal line through (0, 5) and (3, 5)
Slope = 0 (horizontal line), equation y = 5.
Vertical line through (2, 0) and (2, 7)
Undefined slope (vertical line), equation x = 2.
The three line types by slope
| Slope | Line type | Angle |
|---|---|---|
| Positive | Goes up from left to right | Between 0° and 90° |
| Negative | Goes down from left to right | Between 0° and −90° |
| Zero | Horizontal | 0° |
| Undefined | Vertical | 90° |