Skip to main content

Slope Calculator

Calculate the slope (m), grade percentage, roof pitch, angle of inclination, distance, and full line equation from two Cartesian coordinates or rise and run.

First Point: A (x₁, y₁) ?
x₁ =
-10010
y₁ =
-10010
Second Point: B (x₂, y₂) ?
x₂ =
-10010
y₂ =
-10010
Calculated Slope (m)
m = 0.75
Rise / Run = 3 / 4 • Angle: 36.87° • Grade: 75.0% • Pitch: 9:12 • Distance: 5.00
Geometric / Line Metric Computed Value
Slope (m = Δy / Δx) 0.75 (3/4)
Vertical Change (Rise: Δy = y₂ − y₁) 3.00
Horizontal Change (Run: Δx = x₂ − x₁) 4.00
Angle of Inclination (θ = arctan m) 36.87° (0.6435 rad)
Slope Percentage (Grade) 75.00%
Roof Pitch Ratio 9 : 12 (9 in 12)
Euclidean Segment Distance (d) 5.00
Y-Intercept (b, where x = 0) 1.25 (Point: 0, 1.25)
X-Intercept (where y = 0) -1.67 (Point: -1.67, 0)
Slope-Intercept Form y = 0.75x + 1.25
Point-Slope Form y − 2 = 0.75(x − 1)
Standard Form Equation 3x − 4y = -5
💡 Directional Steepness: A positive slope (m > 0) rises from left to right; a negative slope (m < 0) falls downward. A horizontal line has m = 0, and a perfectly vertical line has an undefined slope (infinite steepness).
📐 Roof Pitch vs. Percent Grade: In American residential construction, roof slope is expressed as rise per 12 inches of run (e.g., 9:12 pitch). Highway civil engineering and ADA wheelchair ramp compliance (1:12 max or 8.33%) use percent grade (m × 100%).
⚡ Exact 3-4-5 Triangle: When rise is 3 and run is 4, the distance along the hypotenuse is exactly 5.00—representing the ancient Euclidean Pythagorean triple used to square corners.
x y 36.9° Run = 4 Rise = 3 d = 5.00 A(1, 2) B(5, 5)
Line: y = 0.75x + 1.25
Right Triangle: Δx = 4, Δy = 3
Angle: 36.87°
Live Substituted Arithmetic:
m = (y₂ − y₁) ÷ (x₂ − x₁) = (5.00 − 2.00) ÷ (5.00 − 1.00) = 3.00 ÷ 4.00 = 0.75
Distance d = √[(4.00)² + (3.00)²] = √[16.00 + 9.00] = √25.00 = 5.00

* Results are estimates for educational and planning purposes only and do not constitute formal engineering, architectural, or surveying certification.

Standard Slope, Grade Percentage & Pitch Equivalents

Authoritative civil engineering, architectural roof pitch, and ADA accessibility benchmarks.

Application / Classification Decimal Slope (m) Angle (Degrees) Grade (%) Roof Pitch (in 12) Architectural / Engineering Role
Flat / Level Surface 0.000 0.00° 0.0% 0 : 12 Flat roofs (must have minimum 1/4:12 for drainage), level foundation slabs.
ADA Wheelchair Ramp (Max) 0.083 4.76° 8.33% 1 : 12 Maximum allowable legal slope for accessible ramps per Americans with Disabilities Act.
Interstate Mountain Grade 0.060 3.43° 6.0% 0.72 : 12 Standard maximum gradient for US federal highways to prevent heavy truck brake failure.
Low-Slope Roof 0.250 14.04° 25.0% 3 : 12 Minimum pitch required for standard asphalt fiberglass shingle application.
Conventional Medium Pitch 0.500 26.57° 50.0% 6 : 12 Most common residential gable roof slope; safe walkability for roofers.
3-4-5 Pythagorean Incline 0.750 36.87° 75.0% 9 : 12 Steep residential roof; optimal rain runoff and heavy snow shedding.
45-Degree Steep Slope 1.000 45.00° 100.0% 12 : 12 Equal vertical rise and horizontal run; A-frame chalets and Gothic architecture.
Vertical Wall Undefined (∞) 90.00° Undefined ∞ : 12 Vertical plumb walls, retainers, and sheer drop cliffs (Δx = 0).

Mathematical Formulas & Illustrative Walkthrough

Core Mathematical Formulas:

Slope: m = (y₂ − y₁) ÷ (x₂ − x₁) = Rise ÷ Run Angle of Inclination: θ = arctan(m) Percent Grade: Grade (%) = m × 100% Distance: d = √[ (x₂ − x₁)² + (y₂ − y₁)² ] Line Equation (Slope-Intercept): y = mx + b (where b = y₁ − m × x₁)

Walkthrough Example: Given two coordinates A(1, 2) and B(5, 5):

  • Step 1: Calculate Run (Δx): 5 − 1 = 4
  • Step 2: Calculate Rise (Δy): 5 − 2 = 3
  • Step 3: Calculate Slope (m): 3 ÷ 4 = 0.75 (Simplified fraction: 3/4)
  • Step 4: Find Angle of Incline (θ): arctan(0.75) = 36.87° (0.6435 radians)
  • Step 5: Determine Percent Grade: 0.75 × 100% = 75.0%
  • Step 6: Compute Distance (d): √(4² + 3²) = √(16 + 9) = √25 = 5.00
  • Step 7: Solve for Y-Intercept (b): b = 2 − (0.75 × 1) = 2 − 0.75 = 1.25
  • Step 8: Construct Line Equations: Slope-intercept: y = 0.75x + 1.25; Standard form: 3x − 4y = -5

How to Use This Calculator

  1. Select Calculation Mode: Choose "Two Points" for coordinate geometry, "Rise & Run" for stair/roof/ramp construction, or "Slope & Point" if you already know the line's gradient.
  2. Enter Numeric Coordinates or Dimensions: Type your values directly or adjust the dual range sliders. The 2D coordinate plane updates automatically in real time at 60 FPS.
  3. Inspect Geometric Properties: View the slope, simplified fraction, angle in degrees and radians, percent grade, roof pitch, Euclidean distance, and all standard line equation forms in the breakdown table.
  4. Export Your Results: Click "Copy" to save a formatted technical summary to your clipboard, or "Print" to create a clean PDF document for your blueprints or homework.

Frequently Asked Questions

What does it mean when a line's slope is undefined?

A line has an undefined slope when it is completely vertical (parallel to the y-axis). In this case, the horizontal change between points is zero (Δx = x₂ − x₁ = 0). Because division by zero is mathematically impossible, the slope cannot be expressed as a real number. The equation of such a line is simply x = k (where k is the constant x-coordinate), and its angle of inclination is 90°.

What is the difference between slope, grade percentage, and roof pitch?

All three metrics describe the same underlying steepness ratio (Rise / Run), but format it differently for specific industries. Decimal slope is the pure mathematical ratio (e.g., 0.50). Grade percentage multiplies this ratio by 100 (e.g., 50% grade), used for road grades and ramps. Roof pitch expresses vertical rise over a fixed 12-inch horizontal run (e.g., a 0.50 slope equals a 6:12 pitch, meaning 6 inches of rise per 12 inches of run).

How do you convert slope to an angle of inclination?

To convert slope (m) to an angle (θ), calculate the arctangent (inverse tangent) of the slope: θ = arctan(m). For example, if m = 1, arctan(1) = 45°. If the slope is negative (e.g., m = -1), the angle is -45° (or 135° measured counter-clockwise from the positive x-axis).

How do you find the line equation once the slope is known?

Once slope (m) and a point (x₁, y₁) are known, use the slope-intercept formula y = mx + b. Substitute x₁ and y₁ into the equation and solve for the y-intercept: b = y₁ − m(x₁). For example, with m = 2 and point (1, 3), b = 3 − 2(1) = 1, giving the final equation y = 2x + 1.

What is the relationship between parallel and perpendicular slopes?

Parallel lines have identical slopes (m₁ = m₂), meaning they rise at the exact same rate and never intersect. Perpendicular lines intersect at a 90° right angle, and their slopes are negative reciprocals of each other: m₂ = −1 / m₁ (or m₁ × m₂ = −1). For example, a line perpendicular to slope 3/4 has a slope of −4/3.

✓ Copied to Clipboard!