Math Calculators
Slope Calculator - Find Slope, Equation & Distance Between Two Points
Calculate the slope, y-intercept, line equation, distance, and angle between two points. Shows slope-intercept form y = mx + b instantly.
Point 1 (x₁, y₁)
Point 2 (x₂, y₂)
Line Equation
y = 2x
| Element | x / x₁ | y / y₁ | x₂ | y₂ |
|---|---|---|---|---|
| P₁ | 0 | 0 | ||
| P₂ | 3 | 6 |
Slope formula
The slope of a line through two points (x₁, y₁) and (x₂, y₂) is: m = (y₂ − y₁) / (x₂ − x₁). A positive slope rises left to right; a negative slope falls left to right; a slope of zero is horizontal; an undefined slope is vertical.
Slope-intercept form
Once the slope m is known, the y-intercept b is found with b = y − mx (substitute either point). The line equation is then y = mx + b.
Distance between two points
The distance formula is derived from the Pythagorean theorem: d = √((x₂ − x₁)² + (y₂ − y₁)²).
Rise over run diagram
y
|
5+ ● B (4, 5)
|
3+ ● A (1, 3)
| │
+───►───► x
1 4
Rise = y₂ − y₁ = 5 − 3 = 2
Run = x₂ − x₁ = 4 − 1 = 3
Slope m = Rise / Run = 2/3 ≈ 0.667 A slope of 2/3 means for every 3 units traveled horizontally, you rise 2 units vertically.
Parallel and perpendicular lines
- Parallel lines have equal slopes: if line 1 has slope m₁ and line 2 has slope m₂, the lines are parallel when m₁ = m₂ (and different y-intercepts).
- Perpendicular lines have slopes that are negative reciprocals: m₁ × m₂ = −1. If line 1 has slope 2/3, a perpendicular line has slope −3/2.
Real-world slope applications
- Road gradient: expressed as a percentage (rise ÷ run × 100). A 6% grade rises 6 meters over 100 meters of horizontal distance. Mountain roads frequently have grades of 8–10%; grades above 15% are uncommon for public roads.
- ADA ramp standard: the Americans with Disabilities Act requires wheelchair ramps to have a maximum slope of 1:12, equivalent to 8.33%. Steeper ramps become difficult for wheelchair users to self-propel.
- Roof pitch: expressed as rise:run (e.g., 4:12 means 4 inches of rise per 12 inches of run). A 4:12 pitch equals a slope of 1/3 ≈ 0.333, or about 18.4°.
Gradient vs. slope
In everyday language, "gradient" and "slope" are often used interchangeably. In mathematics, slope is a dimensionless ratio (rise ÷ run); gradient is the vector generalization - in multivariable calculus, the gradient points in the direction of steepest ascent for a multi-dimensional function. For a two-dimensional line, the two terms are equivalent.