Slope Calculator
Calculate the slope (m = Δy / Δx) of a straight line from two coordinates or point-slope parameters, derive full linear equations (y = mx + b), determine angle of inclination, and visualize rise-and-run right triangles on a dynamic Cartesian graph.
Coordinate Points
m = Δy / ΔxSlope & Coordinate
y − y₁ = m(x − x₁)Slope & Line Equation
Interactive Cartesian Line & Slope Triangle Plot
Step-by-Step Slope Derivation
How to Calculate the Slope of a Line
The slope (m) of a line measures its steepness and direction. Given two coordinate points (x₁, y₁) and (x₂, y₂), the slope is calculated by dividing the vertical difference (rise, y₂ − y₁) by the horizontal difference (run, x₂ − x₁). If x₁ = x₂, the slope is undefined (vertical line); if y₁ = y₂, the slope is zero (horizontal line).
Anatomy of Slope (m = Rise / Run = Δy / Δx)
In analytic geometry, slope (often denoted by m from the French word monter, to climb) describes the rate of vertical elevation change relative to horizontal displacement:
Measures the altitude gain (positive) or drop (negative) between the two coordinates.
Measures the lateral span traveled across the horizontal x-axis from left to right.
The Four Types of Slope (Positive, Negative, Zero, Undefined)
Every straight line in a two-dimensional Cartesian plane belongs to one of four fundamental geometric slope categories:
As x increases, y increases proportionally.
As x increases, y decreases steadily.
y is constant: y = b. No vertical rise.
Δx = 0; division by zero is undefined.
Three Core Forms of Linear Equations
Algebraists represent straight lines in three mathematically equivalent coordinate forms:
The standard form where m is the slope and b is the y-intercept (0, b).
Ideal for writing the equation when you know the gradient m and any single coordinate point (x₁, y₁).
Where A, B, C are integers, A ≥ 0, and gcd(A, B, C) = 1.
Parallel vs. Perpendicular Lines
The geometric relationship between two lines is governed by their respective slope values:
Parallel lines never intersect because they ascend or descend at the identical gradient rate.
Perpendicular lines intersect at a right angle (90°). Their slopes are negative reciprocals.
Angle of Inclination (θ = arctan(m)) & Grade %
Slope translates directly into trigonometry and engineering incline units:
Angle of Inclination (θ)
The angle formed between the positive horizontal axis and the line:
Road Grade & Roof Pitch
Civil highway gradient percentage and architectural roof pitch:
Real-World Applications (Civil Engineering, Economics, Kinematics)
Slope is the mathematical foundation for rates of change across all applied sciences:
Civil Highway & ADA Ramp Incline
Building accessibility codes mandate ADA wheelchair ramps have a maximum slope of 1:12 (8.33% grade) to ensure safety.
Physics: Velocity & Acceleration
On a position-time graph, the slope represents velocity (v = Δx / Δt). On a velocity-time graph, slope represents acceleration.
Economics: Marginal Cost & Elasticity
The slope of total cost curves gives marginal cost (MC = ΔC / ΔQ), dictating pricing equilibrium in supply-demand curves.
Hydrology & Drainage Runoff
Landscape architects calculate ground slopes (minimum 2% grade away from foundations) to ensure rainwater drainage prevents structural water intrusion.
Step-by-Step Worked Examples
1. Compute Rise: Δy = y₂ − y₁ = 8 − 2 = 6.
2. Compute Run: Δx = x₂ − x₁ = 4 − 1 = 3.
3. Divide: m = 6 / 3 = 2.
4. Y-intercept: b = y₁ − m(x₁) = 2 − 2(1) = 0.
5. Linear Equation: y = 2x.
Common Calculation Pitfalls & Orientation Errors
Inverting Run over Rise
Writing Δx / Δy instead of Δy / Δx produces the reciprocal slope. Rise (y) is always the numerator.
Inconsistent Coordinate Order
Calculating (y₂ − y₁) / (x₁ − x₂) flips the sign of the slope. Points must be subtracted in identical order.
Confusing Zero vs. Undefined
Horizontal lines have m = 0. Vertical lines have m = Undefined (never zero).
Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.
Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.