Slope Calculator
| Result | Value |
|---|---|
| Slope (m) | 0.5 |
| Distance | 4.472136 |
| Midpoint | (2, 1) |
| Slope-intercept | y = 0.5x + 0 |
| Point-slope | y − 0 = 0.5(x − 0) |
| Angle of inclination | 26.565051° |
m = (y₂ − y₁) / (x₂ − x₁)
Slope and Line Geometry
The slope m of a line through points (x₁, y₁) and (x₂, y₂) measures steepness: m = (y₂ − y₁) / (x₂ − x₁). Positive slope rises left to right; negative slope falls. Zero slope is horizontal; undefined slope (division by zero) means a vertical line x = constant.
Distance between the points uses the distance formula d = √[(x₂−x₁)² + (y₂−y₁)²], equivalent to the Pythagorean theorem on the horizontal and vertical legs. The midpoint is the average of coordinates: ((x₁+x₂)/2, (y₁+y₂)/2).
Slope-intercept form y = mx + b expresses the line with slope m and y-intercept b = y₁ − m·x₁. Point-slope form y − y₁ = m(x − x₁) is useful when you know one point and the slope. The angle of inclination θ = arctan(m) in degrees measures the line's tilt from the horizontal.
The coordinate diagram plots both points, draws the connecting segment, and shows the grid for visual context. Special cases are labeled clearly: "Undefined (vertical line)" when x₁ = x₂ and "0 (horizontal line)" when y₁ = y₂.
Enter any two distinct points (coincident points give distance zero) and copy the full set of line properties for algebra, calculus, or physics problems.
Examples
| Example | Result |
|---|---|
| (0,0) to (4,2) | m = 0.5 |
| (1,1) to (4,5) | m = 4/3 |
| (2,3) to (2,8) | Undefined slope |
| (0,5) to (6,5) | m = 0 |
Frequently asked questions
Slope is undefined. The calculator shows x = constant as the equation.
θ = arctan(m) in degrees, measured from the positive x-axis.
b = y₁ − m·x₁ after computing slope m.