Slope calculator
A slope of 2 means the line rises two units for every one across. That is 63.4° from horizontal and a grade of 200%. Road signs use grade, surveyors use degrees, and algebra homework wants the plain ratio.
Slope is rise over run: the change in y divided by the change in x. For the points (1, 2) and (4, 8) the rise is 6 and the run is 3, so the slope is 2 and the line is y = 2x. A vertical line has no slope at all, because its run is zero and division by zero is undefined.
How to use it
The angle and the grade are easy to confuse. A 100% grade is a 45° slope, not a vertical wall: grade is the tangent of the angle expressed as a percentage. Roads are signed in grade, so a 10% hill climbs one metre for every ten travelled horizontally, an angle of 5.7°.
Questions
The line is vertical, the slope is undefined, and the equation is reported as x equals that value rather than as y = mx + b.
The line falls from left to right. The angle comes back negative too, measured below the horizontal.
Pythagoras on the rise and the run: the square root of rise squared plus run squared.
Not for the slope, the distance or the midpoint. Swapping them flips the sign of both the rise and the run, and the ratio is unchanged.