Slope Calculator
Find the slope, y-intercept, and equation of a line given two points. Also calculates the angle, distance, and provides the slope-intercept form (y = mx + b).
Slope measures the steepness and direction of a line. The slope formula m = (y₂ - y₁) / (x₂ - x₁) — often remembered as "rise over run" — gives a single number that captures everything about a line's tilt. Positive slope means uphill from left to right; negative means downhill; zero means horizontal; undefined means vertical.
Slope is fundamental to coordinate geometry, algebra, physics, and any field involving rates of change: - **Roads and ramps**: 5% grade means rise 5 units per 100 units horizontal. - **Roofs**: pitch expressed as ratio (12/12 = 45°). - **Stairs**: rise (riser height) over run (tread depth). - **Economics**: marginal cost = slope of cost curve. - **Physics**: velocity = slope of position vs time graph. - **Statistics**: slope of regression line.
The line equation in slope-intercept form is y = mx + b, where m is slope and b is y-intercept (where line crosses y-axis). Given two points, you can find m using the slope formula, then solve for b. The complete equation describes every point on the line.
Slope connects to angle: tan(angle) = slope. A slope of 1 corresponds to 45°. Slope 0.577 ≈ tan(30°). Slope 1.732 ≈ tan(60°).
Common applications: line graphing, road and ramp design, roof pitch calculations, regression analysis, physics motion problems, economics cost analysis, and any quantitative analysis of linear relationships.
Inputs
Results
Slope (m)
2
Y-Intercept (b)
0
Line Equation
y = 2x + 0
Angle
63.43°
Distance Between Points
6.708204
Formula
How to use this calculator
- Enter coordinates of first point (x₁, y₁).
- Enter coordinates of second point (x₂, y₂).
- Calculator returns slope, y-intercept, line equation, and angle.
- For vertical line (same x): slope undefined; reported as such.
- For horizontal line (same y): slope = 0.
- Angle = arctan(slope) gives the line's inclination from horizontal.
Worked examples
Road grade
**Scenario:** Road rises 50 ft over 1000 ft horizontal. Slope and grade? **Calculation:** Slope = 50/1000 = 0.05. Grade = 5%. Angle: arctan(0.05) ≈ 2.86°. **Result:** 5% grade — gentle but noticeable. US interstates allow up to 6% in mountainous regions. Most highways < 5%. Steep streets like Lombard (SF) can be 30%+ (~16.7° angle).
Roof pitch
**Scenario:** Roof rises 6 inches per 12 inches horizontal (6/12 pitch). Slope and angle? **Calculation:** Slope = 6/12 = 0.5. Angle: arctan(0.5) ≈ 26.57°. **Result:** 6/12 pitch is common for residential roofs. 12/12 = 45° (very steep). Pitches above 12/12 = "steep slope" — usually require special framing techniques.
Statistical regression slope
**Scenario:** Two data points (years experience, salary): (2, 50000) and (10, 90000). Slope of trend line. **Calculation:** Slope = (90000 - 50000) / (10 - 2) = 40000/8 = 5000. **Result:** Slope = $5,000/year. Each additional year of experience associated with $5,000 salary increase (on this simple line). Real regression uses many data points; slope from least-squares method.
When to use this calculator
**Use slope calculations for:**
- **Coordinate geometry**: graphing lines. - **Algebra**: linear equations and functions. - **Construction**: ramps, roads, roofs, stairs. - **Engineering**: grade calculations, structural angles. - **Physics**: motion graphs (velocity, acceleration). - **Statistics**: regression analysis. - **Economics**: cost curves, supply-demand. - **Real estate**: lot grading.
**Slope formulas summary:**
- **From two points**: m = (y₂ - y₁) / (x₂ - x₁). - **Slope-intercept form**: y = mx + b. - **Point-slope form**: y - y₁ = m(x - x₁). - **Standard form**: Ax + By = C.
All represent the same line; choose based on what's known.
**Parallel and perpendicular:**
- **Parallel lines**: same slope (different y-intercepts). - **Perpendicular lines**: slopes are negative reciprocals (m₁ × m₂ = -1).
Examples: - y = 2x + 3 and y = 2x - 5: parallel. - y = 2x + 3 and y = -1/2 x + 1: perpendicular.
**Slope as percentage (grade):**
slope × 100 = grade %. 0.05 = 5% grade. 0.10 = 10% grade.
Used for: roads, ramps, ski slopes, drainage.
**Slope to angle:**
angle = arctan(slope).
| Slope | Angle | |---|---| | 0 | 0° | | 0.5 | 26.6° | | 1 | 45° | | 2 | 63.4° | | √3 ≈ 1.732 | 60° | | 1/√3 ≈ 0.577 | 30° |
**Common applications:**
- **Roof pitch**: 4/12, 6/12, 8/12, 12/12 ratios. - **Road grade**: typically 0-6% (highways), 5-15% (driveways). - **ADA ramp**: max 1:12 (8.33%). - **Wheelchair ramp**: 1:12 max for accessibility. - **Stairs**: 7-11 inch rise over 11 inch run (slope ~ 0.7-1). - **Bicycle climbs**: tour de France stages have 10%+ grades. - **Aircraft glide slope**: typically 3° (~5% slope).
**Slope in motion graphs:**
- **Position vs time**: slope = velocity. - **Velocity vs time**: slope = acceleration. - **Distance vs time**: slope = speed.
Instantaneous slope (derivative in calculus) gives instantaneous rate.
**Real estate / land**:
Property slopes affect: - Drainage. - Building feasibility. - Construction cost. - Accessibility. - View.
Typical: 0-5% buildable easily; 5-15% needs grading; >15% challenging.
**ADA compliance:**
Wheelchair ramps: - Max slope 1:12 (8.33%). - Max rise 30 inches before landing. - Min width 36 inches.
Important for accessibility design.
**Software:**
- **Spreadsheets**: SLOPE function for regression. - **Calculators**: manual computation. - **CAD**: built-in slope tools. - **GIS**: terrain slope from elevation data. - **Surveying**: total stations measure slopes directly.
**Pitfalls:**
- **Vertical line**: slope undefined; use x = constant. - **Horizontal line**: slope = 0. - **Sign errors**: positive vs negative direction. - **Reversed points**: same slope from either direction. - **Slope vs grade**: grade = slope × 100%. - **Slope vs angle**: angle = arctan(slope). - **For perpendicular**: negative reciprocal; not just -slope.
**Educational use:**
Slope is foundational in: - Algebra (linear equations). - Geometry (parallel/perpendicular). - Pre-calculus (rate of change). - Calculus (derivatives). - Statistics (regression).
Mastery sets stage for higher math.
**Pitfalls (continued):**
- **For lines with very small slope**: precision matters. - **For very steep slopes (near vertical)**: angle approaches 90°. - **Confusing slope (line) with gradient (multi-dimensional)**. - **In real-world units**: ensure rise and run in same units.
Common mistakes to avoid
- Reversing rise and run (use Δy/Δx, not Δx/Δy).
- For vertical line: trying to compute slope (undefined).
- Sign errors (slope direction).
- For perpendicular: using negative slope instead of negative reciprocal.
- Mixing slope (decimal) with grade (percentage).
- Confusing slope with angle (slope = tan of angle).
- Using slope-intercept form when point-slope is more natural.
- For real-world: mixing units (rise in m, run in ft).