ADVERTISEMENT
728 × 90 Responsive Top Leaderboard Banner

Slope, Distance & Midpoint Calculator

Compute exact simplified fraction slope (m), % grade, angle (θ), simplified radical distance (d), midpoint (M), and full line equations (Slope-Intercept, Point-Slope, & Standard Form) with an interactive SVG coordinate graph.

Presets:
Point 1 — P₁(x₁, y₁)
( , )
Point 2 — P₂(x₂, y₂)
( , )
ADVERTISEMENT
Responsive In-Content Banner (728 × 90 or 336 × 280)

How Slope, Distance & Line Equations Work

Any two distinct points P1(x1, y1) and P2(x2, y2) determine a single unique straight line in the Cartesian plane. Comparing their vertical change (Rise, Δy = y2 − y1) to their horizontal change (Run, Δx = x2 − x1) quantifies both the line's direction and steepness, while applying the Pythagorean Theorem yields Euclidean distance d.

Slope Formula (Rise over Run)

Rate of change per unit increase in x

m = y2 − y1x2 − x1 = ΔyΔx

If m > 0 the line rises right; if m < 0 it falls right; if Δy = 0 slope is 0 (horizontal); if Δx = 0 slope is Undefined (vertical line x = x1).

Pythagorean Distance Formula

Hypotenuse length between P1 and P2

d = √(x2 − x1)² + (y2 − y1)²

The dashed horizontal Run Δx and vertical Rise Δy form legs of a right triangle whose hypotenuse is segment P1P2, simplified cleanly by factoring perfect squares out of the radical.

The Four Fundamental Types of Linear Slope

Positive m > 0
Uphill Left-to-Right: Both y and x move in the same direction (e.g., m = 2 rises 2 units for every 1 unit right, angle 0° < θ < 90°).
Negative m < 0
Downhill Left-to-Right: Increasing x decreases y (e.g., m = −3/2 drops 3 units for every 2 units right, angle −90° < θ < 0°).
Zero m = 0
Horizontal Line (y = b): Zero vertical rise (Δy = 0), giving 0% grade and 0° angle. Its perpendicular counterpart is a vertical line.
Undefined
Vertical Line (x = a): Zero horizontal run (Δx = 0), making Δy / 0 undefined. Inclination angle equals 90° (π/2 rad) and perpendicular slope is 0.

Coordinate Geometry Formula Reference Table

Every form, angle metric, and orthogonal relationship computed simultaneously by this tool:

Form / Metric Exact Formula Geometric Meaning & Edge Cases
Slope-Intercept Form y = mx + b Highlights slope m and Y-intercept (0, b); does not exist for vertical lines (x = a).
Point-Slope Form y − y1 = m(x − x1) Anchored directly at (x1, y1) without needing the Y-intercept first.
Standard Form Ax + By = C Integer coefficients with A ≥ 0; represents every line including vertical (1x + 0y = a).
Midpoint M ((x1+x2)/2, (y1+y2)/2) Exact geometric center bisecting segment P1P2 into two equal halves of length d/2.
Grade & Angle 100m%, θ = arctan(m) Used in road engineering and roof pitches (100% grade equals m = 1, θ = 45°).
Perpendicular Slope m⊥ = −1 / m Intersects the original line at 90°; zero slope pairs with undefined vertical slope.

Frequently Asked Questions

Subtract y-coordinates divided by subtracted x-coordinates in matching point order: m = (y2 − y1) / (x2 − x1). Swapping P1 and P2 flips signs on both numerator and denominator, leaving the slope m completely unchanged.

A horizontal line has zero change in height (Δy = 0), giving m = 0 / Δx = 0. A vertical line has zero horizontal run (Δx = 0), making Δy / 0 mathematically undefined, so its equation simplifies to x = x1.

Inside √(Δx² + Δy²), we extract the largest integer perfect square factor k² dividing the radicand so √(k² · s) = k√s. For instance, between (1, 2) and (5, 10), 4² + 8² = 80 = 16 × 5 simplifies directly to exact 4√5 (~8.9443).

Every line parallel to your segment shares the exact same slope m (or is also vertical if Δx = 0). Any line perpendicular to a slanted line of slope m = a/b has the negative reciprocal slope m⊥ = −1 / m = −b / a.

Yes! Enter integers, negative coordinates, terminating decimals (like 0.5 or -2.25), or even fractional values like -3/4 in slope/coordinate inputs. Everything runs 100% locally in your browser with instant SVG graphing.

Explore Our Free Calculator Series

Fast, privacy-first math & statistical utilities running 100% in your browser.

ADVERTISEMENT
Responsive Bottom Banner (728 × 90 or Auto)