Slope Calculator
Slope, intercept, and distance for a line through two points.
What it does
Slope measures a line steepness as rise over run: how far y climbs per unit of x. Two points fix a line completely, yielding slope, intercept, and the distance between them in one pass.
The tool above takes both points. It returns the slope, the y-intercept with the full equation, and the point distance, handling vertical lines gracefully.
Sign tells direction at a glance. Positive slopes climb right, negative fall, zero runs flat, and undefined stands vertical where x never changes.
Slope-intercept form rules applied math from ramps to rates. The m in y equals mx plus b is literally this slope, and b is where the story starts at zero.
How to use
- Enter both points with signs and decimals.
- Read slope first for steepness and direction.
- Read the equation for graphing or predicting.
- Read distance for length along the segment.
Formula
- rise / run
- y change over x change between the points.
- b
- y value where the line crosses x equals zero.
- distance
- Straight length via Pythagoras.
Vertical lines divide by zero, so slope stays undefined while distance still computes. Identical points define nothing and error out.
Worked example
Example: (0,0) to (4,3)
Points origin and (4,3).
- Slope: (3 - 0) / (4 - 0) = 0.75.
- Intercept: 0 - 0.75 x 0 = 0. Line y = 0.75x + 0.
- Distance: sqrt(16 + 9) = sqrt(25) = 5.
- Classic 3-4-5 triangle hiding in coordinates.
Reference table
| Slope | Angle | Character |
|---|---|---|
| 0 | 0° | Flat |
| 1 | 45° | Even climb |
| 0.75 | 36.9° | Gentle |
| -1 | -45° | Even fall |
| undefined | 90° | Vertical |
Limits
- Straight lines only. Curves need calculus.
- Identical points define nothing.
- Floating point rounds long decimals.
- Extrapolation past data needs judgment.
Common mistakes
- Flipping rise and run in the division.
- Dropping signs on differences.
- Calling vertical slope zero instead of undefined.
- Reading intercept off unscaled graphs.
- Extending lines far past the data.
Try it yourself
Quick checks. Answers sit tucked under each question.
Slope through (2,1) and (6,9)?
(9-1)/(6-2) = 8/4 = 2.
Distance between those points?
sqrt(16 + 64) = sqrt(80) = 8.9443.
Questions
What is slope in plain words?
Steepness as rise over run. A slope of 2 climbs two for each one across.
What is undefined slope?
Vertical lines where x never changes. Division by zero has no answer.
How are parallel lines related?
Equal slopes. Perpendicular lines multiply to minus one.
What is the intercept for?
Starting value at x zero: base price, initial height, fixed cost.
Slope or angle?
Same story two ways: angle is arctan of slope.
Can slope use any units?
Yes, rise and run share whatever units the points carry.