CalcMountain

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

Last updated:

Formula

**Slope formula:** m = (y₂ - y₁) / (x₂ - x₁) = Δy / Δx = rise / run Where (x₁, y₁) and (x₂, y₂) are two points on the line. **Slope-intercept form of line:** y = mx + b Where: - m = slope - b = y-intercept (value of y when x = 0) **Point-slope form:** y - y₁ = m(x - x₁) Useful when you have one point and the slope. **Standard form:** Ax + By = C (general linear equation). **Worked example:** Points (1, 2) and (4, 8). m = (8 - 2) / (4 - 1) = 6/3 = 2. Slope = 2 (rises 2 units for every 1 unit right). Y-intercept: y = mx + b. Using (1, 2): 2 = 2(1) + b. b = 0. Equation: y = 2x. **Categories of slopes:** | Slope | Direction | |---|---| | Positive (m > 0) | Uphill, left to right | | Negative (m < 0) | Downhill, left to right | | Zero (m = 0) | Horizontal | | Undefined | Vertical (x₂ = x₁) | **Common slopes:** | Slope | Angle | Description | |---|---|---| | 0 | 0° | Flat | | 0.05 | ~2.86° | Gentle ramp | | 0.1 | ~5.7° | 10% grade | | 0.577 | 30° | tan(30°) | | 1 | 45° | Symmetric (rise = run) | | 1.732 | 60° | tan(60°) | | ±∞ | ±90° | Vertical | **Slope to angle:** angle = arctan(m) For slope 0.5: angle = arctan(0.5) ≈ 26.57°. **Common slope conversions:** | Slope as ratio | Slope as % | Angle | |---|---|---| | 1:50 | 2% | 1.15° | | 1:20 | 5% | 2.86° | | 1:12 | 8.33% | 4.76° (max ADA ramp) | | 1:10 | 10% | 5.71° | | 1:5 | 20% | 11.31° | | 1:3 | 33.3% | 18.43° | | 1:2 | 50% | 26.57° | | 1:1 | 100% | 45° | | 2:1 | 200% | 63.43° | **Parallel and perpendicular lines:** - **Parallel**: same slope. m₁ = m₂. - **Perpendicular**: negative reciprocal. m₁ × m₂ = -1. If line has slope 2, perpendicular has slope -1/2. If slope 1/3, perpendicular has slope -3. **Finding y-intercept:** Given slope m and point (x₀, y₀): b = y₀ - m × x₀. For slope 2 through (3, 5): b = 5 - 2(3) = -1. Equation: y = 2x - 1. **Line through two points:** Given (x₁, y₁) and (x₂, y₂): 1. Calculate slope m. 2. Use point-slope form: y - y₁ = m(x - x₁). 3. Or solve for y-intercept and use slope-intercept form. For (2, 3) and (5, 9): m = (9-3)/(5-2) = 2. Using (2, 3): 3 = 2(2) + b. b = -1. y = 2x - 1. Verify with (5, 9): y = 2(5) - 1 = 9. ✓ **Vertical lines:** Vertical: x = constant. Slope undefined (division by zero). Equation: x = a (not y = mx + b). **Horizontal lines:** Horizontal: y = constant. Slope = 0. Equation: y = b. **Grade (slope as percentage):** For roads, ramps, and trails: grade = slope × 100 = (rise/run) × 100% 5% grade: rises 5 ft per 100 ft horizontal. - US interstate maximum: 6% (mountainous regions). - ADA accessibility ramp max: 8.33% (1:12). - Most driveways: 5-15%. - Steep streets (San Francisco): 30%+. **Roof pitch:** Expressed as rise/run (often x/12): - **4/12**: low slope, ~18.4°. - **6/12**: common, 26.57°. - **8/12**: steeper, 33.7°. - **12/12**: 45°, very steep. Pitch above 12/12 (e.g., 18/12) is "steep slope". **Stairs:** Riser height (rise) and tread depth (run). Standard: - Riser: 7-7.75 inches. - Tread: 10-11 inches. - Slope: ~32-37° for comfort. OSHA, building codes specify limits. **Physics applications:** - **Velocity = slope of position vs time graph.** - **Acceleration = slope of velocity vs time graph.** - **Resistance = slope of voltage vs current (Ohm's law).** **Common applications:** - **Coordinate geometry**: graphing lines. - **Construction**: roads, ramps, drainage. - **Architecture**: stairs, roof pitches. - **Physics**: motion graphs. - **Economics**: cost curves, supply-demand. - **Statistics**: regression analysis. - **Computer graphics**: line rasterization. - **GPS/Surveying**: terrain analysis. **Software:** - **Calculators**: simple division. - **Spreadsheets**: SLOPE function for linear regression. - **CAD**: built-in slope tools. - **GIS**: terrain slope analysis. **Pitfalls:** - **Vertical line**: slope undefined; don't try to compute. - **Reversal**: same slope from (1,2) to (3,5) or reverse. - **Sign**: positive vs negative changes direction. - **Slope vs angle**: related but different (slope is tan of angle). - **Slope as percentage vs decimal**: 5% = 0.05. **Educational notes:** Slope is core algebra topic: - 7th-8th grade: intro with graphs. - High school algebra: linear equations. - Pre-calculus: rates of change. - Calculus: derivative as instantaneous slope. Foundation for understanding linear and nonlinear functions. **Common applications:** - **Algebra homework**: graphing, line equations. - **Construction**: ramp, road, roof angles. - **Civil engineering**: drainage, terrain. - **Physics**: graph analysis. - **Statistics**: regression slope. - **Economics**: marginal analysis. - **Mountain biking/skiing**: trail grades. **Slope of perpendicular line:** For perpendicular: m₁ × m₂ = -1. So if m₁ = 3, m₂ = -1/3. If m₁ = 2/5, m₂ = -5/2. Used to find perpendicular bisectors, normals to curves, right-angle geometry. **Software:** - **Excel**: SLOPE(known_y, known_x) function for regression. - **Python (numpy)**: np.polyfit(x, y, 1). - **R**: lm(y ~ x) for linear regression. - **MATLAB**: polyfit(x, y, 1). - **Calculators**: simple manual calculation. **Pitfalls:** - **Division by zero**: vertical line has undefined slope. - **Sign error**: wrong slope direction. - **Confusing rise/run order**: rise over run, not run over rise. - **Two equivalent forms**: y = mx + b and y - y₁ = m(x - x₁) give same line. - **Slope vs gradient**: slope is 2D; gradient generalizes to higher dimensions.

How to use this calculator

  1. Enter coordinates of first point (x₁, y₁).
  2. Enter coordinates of second point (x₂, y₂).
  3. Calculator returns slope, y-intercept, line equation, and angle.
  4. For vertical line (same x): slope undefined; reported as such.
  5. For horizontal line (same y): slope = 0.
  6. 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).

Frequently Asked Questions

Sources & further reading

SponsoredShop Top Deals on AmazonSupport CalcMountain — browse top-rated products at no extra cost to you.

Related Calculators