Slope Calculator Compute slope, angle, grade, distance, and line equations — with real-world applications and 2025 math s...
Slope Calculator
Compute slope, angle, grade, distance, and line equations — with real-world applications and 2025 math standards.
Slope (m)**:
$$ m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{\text{Rise}}{\text{Run}} $$
Angle (θ)**:
$$ \theta = \tan^{-1}(m) \quad \text{(degrees)} $$
Distance (d)**:
$$ d = \sqrt{(x_2 - x_1)^2 + (y_2 - y_1)^2} $$
Grade (%)**:
$$ \text{Grade} = m \times 100\% $$
Example** (Points (2,3) and (6,9)): • Δy = 6, Δx = 4 → **m = 1.5** • θ = tan⁻¹(1.5) = **56.3°** • Grade = 150% • Distance = √(4² + 6²) = **7.21 units**
✅ Pro Tip**: Positive slope = uphill (↗), negative = downhill (↘), zero = flat (→), undefined = vertical (↑).
⚠️ Avoid these common errors:
- Δy/Δx inverted** — Rise over run, *not* run over rise
- Sign errors** — (3−9)/(2−6) = (−6)/(−4) = +1.5 (not −1.5!)
- Undefined slope** — Division by zero (x₂ = x₁) → vertical line
- Unit mix-ups** — Rise in feet, run in meters → false slope
✅ Real-World Tips**:
- Roof pitch**: 6:12 = 6" rise per 12" run = **50% grade**, **26.6°**
- ADA ramp**: Max 1:12 = **8.3% grade**, **4.8°** — steeper requires handrails
- Highway grade**: 6% = 6 ft rise per 100 ft = **3.4°** — safe for trucks
| Application | Slope (m) | Grade | Angle |
|---|---|---|---|
| Driveway (max) | 0.25 | 25% | 14.0° |
| Wheelchair Ramp | 0.083 | 8.3% | 4.8° |
| Roof (4:12) | 0.333 | 33.3% | 18.4° |
| Hiking Trail (steep) | 0.50 | 50% | 26.6° |
| Black Diamond Ski Run | 1.00+ | 100%+ | 45°+ |
📉 Equation Forms**:
- Slope-Intercept**: y = mx + b
- Point-Slope**: y − y₁ = m(x − x₁)
- Standard**: Ax + By = C
➡️ Two Points
“(2,3) and (6,9) — slope?” → **m = 1.5**, **θ = 56.3°**, **d = 7.21**
➡️ Rise & Run
“Rise 4 ft over 10 ft run” → **m = 0.4**, **grade = 40%**, **θ = 21.8°**
➡️ Angle ↔ Slope
“Slope 1.0 ↔ Angle 45°” — verify conversion
➡️ Line Equation
“m = 2 through (1,5)” → **y = 2x + 3**
Note: Uses exact math (Math.atan, Math.sqrt). Handles vertical/horizontal edge cases. Units preserved in distance output.