Slope Calculator
Calculate slope, y-intercept, line equation, distance, and midpoint from two points.
Returns slope-intercept form for algebra, geometry, and graphing.
Slope is one of the most fundamental concepts in mathematics — it quantifies the steepness and direction of a straight line between any two points on a coordinate plane. Slope appears everywhere: in physics (speed is slope on a distance-time graph), economics (marginal cost), engineering (road grades), and data science (linear regression).
Core formulas:
Slope (m) = (y₂ − y₁) / (x₂ − x₁) = Rise / Run
Slope-Intercept Form: y = mx + b
Point-Slope Form: y − y₁ = m(x − x₁)
Y-Intercept: b = y₁ − m × x₁
Distance Between Two Points: d = √((x₂ − x₁)² + (y₂ − y₁)²)
Midpoint: M = ((x₁ + x₂) / 2, (y₁ + y₂) / 2)
Variable definitions:
- m — slope; the ratio of vertical change (rise) to horizontal change (run)
- b — y-intercept; where the line crosses the y-axis (x = 0)
- Rise — vertical change between two points (y₂ − y₁)
- Run — horizontal change between two points (x₂ − x₁)
- (x₁, y₁) and (x₂, y₂) — any two distinct points on the line
Worked example: Two points: (2, 3) and (8, 15) Slope = (15 − 3) / (8 − 2) = 12 / 6 = 2 Y-intercept: b = 3 − 2 × 2 = −1 Line equation: y = 2x − 1 Distance = √((8−2)² + (15−3)²) = √(36 + 144) = √180 = 13.42 Midpoint = ((2+8)/2, (3+15)/2) = (5, 9)
Interpreting slope values:
| Slope | Line Direction | Real-World Example |
|---|---|---|
| Positive | Rising left to right | Car gaining speed |
| Negative | Falling left to right | Asset losing value |
| Zero | Horizontal | Constant speed |
| Undefined | Vertical | Instantaneous change |
| m = 1 | 45° angle up | Equal rise and run |
| m = −1 | 45° angle down | Equal but opposite |
Perpendicular and parallel slopes:
- Parallel lines share the same slope: m₁ = m₂
- Perpendicular lines: m₁ × m₂ = −1 (slopes are negative reciprocals)
Angle of inclination: θ = arctan(m) — at slope = 1, the angle is exactly 45°; at slope = 10, the angle is ~84.3°.