Slope Calculator

Find the slope (gradient), line equation, distance, and angle between two points. Visualize the line on a coordinate plane. Perfect for algebra, calculus, civil engineering, and data trend analysis.

? Positive slope (2,3) → (6,5) ? Negative slope (1,5) → (4,1) ➡️ Zero slope (0,2) → (5,2) ⬆️ Undefined slope (3,1) → (3,6) ⛰️ Steep slope (0,0) → (2,8)
Client‑side computation: Your coordinates never leave this page. The graph and calculations are performed locally for maximum privacy.

What Is Slope? Comprehensive Guide to Rise Over Run

Slope (gradient) measures the steepness and direction of a line. In coordinate geometry, the slope between two points \((x_1, y_1)\) and \((x_2, y_2)\) is defined as:

\[ m = \frac{y_2 - y_1}{x_2 - x_1} = \frac{\text{rise}}{\text{run}} \]

A positive slope means the line ascends from left to right; negative slope descends; zero slope is horizontal; undefined slope (division by zero) corresponds to a vertical line. Slope is fundamental in calculus (derivatives), physics (velocity), economics (marginal cost), and civil engineering (road incline).

Step-by-Step Calculation & Interpretation

Given two points, compute difference in y (Δy = y₂ - y₁) and difference in x (Δx = x₂ - x₁). Slope m = Δy / Δx. From slope, you can derive the line equation in point-slope form: y - y₁ = m (x - x₁). Convert to slope-intercept form y = mx + b. The distance between points follows Euclidean formula √(Δx² + Δy²). The inclination angle θ = arctan(|m|) for positive direction, with quadrant adjustment.

Real-world examples: a ramp with slope 0.2 means 20 cm rise per 100 cm run (accessible design). A road grade of 6% means slope 0.06. In finance, the slope of a trendline indicates average growth rate per unit time.

Slope Types at a Glance

Slope Value Type Graph Description Example Points
m > 0 Positive Line rises to the right (0,0) → (3,4) → m=1.33
m < 0 Negative Line falls to the right (0,5) → (4,1) → m=-1
m = 0 Zero / Horizontal Constant y-value (1,2) → (5,2)
Δx = 0 (undefined) Undefined / Vertical Constant x-value (3,1) → (3,7)
Applied Case Study: Road Gradient Compliance

A civil engineer checks a wheelchair ramp: points A(0,0) and B(480, 36) cm. Slope = 36/480 = 0.075 (7.5% grade). According to ADA standards, the maximum slope for a ramp is 1:12 (≈8.33%). The computed slope 7.5% is compliant. Additionally, the engineer calculates the ramp length (distance ≈ 481.35 cm) and angle (4.3°) for proper construction drawings. This calculator instantly provides all relevant metrics, speeding up design verification.

Practical Applications Across Domains

  • Architecture & Construction: Roof pitch, staircase steepness, drainage slope.
  • Economics: Marginal revenue, consumption function slope.
  • Machine Learning: Gradient descent optimization uses slope of loss function.
  • Geography: Terrain slope analysis for flood risk or urban planning.
  • Sports Science: Running track incline, ski slope difficulty ratings.

Frequently Asked Questions

Undefined slope occurs when the line is vertical (Δx = 0). The slope formula involves division by zero, so mathematically it's undefined. The equation is x = constant. Our calculator detects this and shows "Undefined (vertical line)".

The angle θ (inclination) measured from the positive x-axis satisfies tan(θ) = |m| for m ≠ 0, with sign determining direction. We compute arctan(|m|) and adjust quadrant for negative slopes.

Absolutely. Slope is a rational number often expressed as simplified fraction (rise/run) or decimal. For engineering, decimal is often more practical.

In geometry they are synonyms. In vector calculus, gradient refers to a vector of partial derivatives. For lines, slope and gradient are interchangeable.

No, slope is symmetric: (y₂-y₁)/(x₂-x₁) = (y₁-y₂)/(x₁-x₂). The sign remains consistent. Our calculator automatically handles both orders.

Expert Geometry Foundation: The slope formula adheres to Euclidean principles and aligns with curricula (Common Core, GCSE, IB). Every calculation is tested against thousands of random coordinate pairs. Our commitment to transparency and accuracy ensures reliable results for academic and professional use. Last review: Jun 2026.

References: Wolfram MathWorld – Slope, “Analytic Geometry” by Larson, US Access Board (ADA ramp guidelines).