How to use this calculator
- Enter or choose x₁.
- Enter or choose y₁.
- Enter or choose x₂.
- Enter or choose y₂.
- The slope (m) updates as you type. Use Copy result or Share to keep it.
Method
m = (y₂ − y₁) ÷ (x₂ − x₁); b = y₁ − m·x₁; θ = arctan m; d = √((x₂ − x₁)² + (y₂ − y₁)²)
- (x₁, y₁), (x₂, y₂)
- the two points
- m
- slope
- b
- where the line crosses the y-axis
- θ
- angle of the line above the x-axis
Worked example
- Rise = 5 − 2 = 3; run = 5 − 1 = 4; m = 3 ÷ 4 = 0.75.
- b = 2 − 0.75 × 1 = 1.25, so y = 0.75x + 1.25.
- Distance = √(4² + 3²) = √25 = 5.
The line through (1, 2) and (5, 5) has slope 3/4 and equation y = 0.75x + 1.25.
What the result means
A positive slope rises from left to right, a negative one falls. A slope of 0.75 means y goes up 3 for every 4 across, or 75% as a road or ramp grade.
Assumptions and limits
- Points are on a flat x–y plane with the same scale on both axes (the angle depends on this).
- A vertical line (x₁ = x₂) has no defined slope; the calculator gives its equation as x = constant.
Questions
What is the difference between slope and grade?
Grade is slope written as a percentage: a slope of 0.05 is a 5% grade, rising 5 m over 100 m horizontally.
Do parallel and perpendicular lines have related slopes?
Parallel lines have equal slopes. Perpendicular lines have slopes that multiply to −1, such as 2 and −½.