Slope calculator
Everything a straight line through two points can tell you, in one place.
Slope
2
- y-intercept
- -1
- Distance between the points
- 13.416 407 865
- Angle from horizontal
- 63.434 95 degrees
- Midpoint x
- 5
- Midpoint y
- 9
- Perpendicular slope
- -0.5
- As a percentage grade
- 200.0000 %
Show the working
- x1 = 2
- y1 = 3
- x2 = 8
- y2 = 15
- dx = 8 - 2 = 6
- dy = 15 - 3 = 12
- Slope = 6 != 0 ? 12 / 6 : 0 = 2
- y-intercept = 3 - 2 * 2 = -1
- Distance between the points = hypot(6, 12) = 13.4164
- Angle from horizontal = deg(atan2(12, 6)) = 63.4349
- Midpoint x = (2 + 8) / 2 = 5
- Midpoint y = (3 + 15) / 2 = 9
- Perpendicular slope = 2 != 0 ? -1/2 : 0 = -0.5
- As a percentage grade = 2 * 100 = 200
Values are shown to six significant figures here; the arithmetic itself runs on exact fractions and is only rounded where a number is printed.
Scenarios & local history
Compare a saved scenario
Recent calculations
The formula
- slope m = (y2 - y1) / (x2 - x1)
- y = mx + b with b = y1 - m x1
- distance = sqrt(dx^2 + dy^2)