Two points in — slope, intercept, angle and y = mx + b out.
📏 m = (y₂ − y₁)/(x₂ − x₁) is rise over run; b = y₁ − m·x₁ anchors the line. Parallel lines share m; perpendicular lines multiply to −1 (m⊥ = −1/m). A vertical segment has undefined slope, a horizontal one m = 0.
The Slope Calculator is based on the following formula:
m = (y₂ − y₁) / (x₂ − x₁) b = y₁ − m·x₁ θ = arctan(m) Perpendicular slope: m⊥ = −1/m
Variables: (x₁, y₁), (x₂, y₂) = The two points m = Slope (rise over run) b = Y-intercept θ = Inclination angle in degrees m⊥ = Slope of a perpendicular line
Slope is the vertical change per unit of horizontal change between two points; anchoring it through either point yields the y-intercept and the full equation y = mx + b. Parallel lines share m; perpendicular slopes multiply to −1, so each is the negative reciprocal of the other.
Worked example: Step 1: points (1, 2) and (4, 8). Step 2: m = (8 − 2)/(4 − 1) = 6/3 = 2. Step 3: b = y₁ − m·x₁ = 2 − 2·1 = 0, so the line is y = 2x. Step 4: θ = arctan(2) = 63.43°. Step 5: perpendicular slope m⊥ = −1/2 = −0.5. Result: m = 2, b = 0, angle 63.43°, equation y = 2x, m⊥ = −0.5 — identical to the tool's output.
Slope is m = (y₂ − y₁)/(x₂ − x₁): the vertical change per unit of horizontal change between your two points. A slope of 2 climbs 2 units for every 1 across; −0.5 descends half a unit per unit across. Once m is known, the y-intercept follows from b = y₁ − m·x₁ and you have the full equation y = mx + b.
Identical points give no slope at all — there is no line to define. Equal x-values mean a vertical line with undefined slope (the run is zero, and the equation is simply x = c). Equal y-values mean a horizontal line with m = 0. Textbooks lose more points on these three cases than on the arithmetic itself.
The inclination angle is θ = arctan(m): m = 1 gives 45°, m = 2 gives 63.43°, and m = √3 gives 60°. Road signs use grade instead — rise/run × 100 — so a seemingly steep 8% grade is only arctan(0.08) ≈ 4.6°, which is why cars can climb it at all.
Parallel lines share exactly the same slope. Perpendicular lines multiply to −1, so the perpendicular slope is −1/m — flip the fraction and change the sign. The special cases follow automatically: the perpendicular to a horizontal line is vertical, and vice versa, which the calculator states explicitly instead of dividing by zero.
More tools you might find useful
Find sphere volume and surface area from radius.
Calculate standard deviation, variance, and mean.
Find trapezoid area from two parallel sides and height.
Solve right triangles — hypotenuse, area, perimeter.