Slope Calculator
Find the slope (gradient) of a line from two points, with the slope type and the equation y = mx + b calculated automatically.
Calculation Examples
📋Steps to Calculate
-
Enter the coordinates of the first point: x1 and y1.
-
Enter the coordinates of the second point: x2 and y2.
-
Click "Calculate" to view the slope value m, its type, and the line equation y = mx + b.
Mistakes to Avoid ⚠️
- Subtracting coordinates in different orders. The formula needs the same point first in both parts: (y2 - y1) / (x2 - x1). Using (y2 - y1) / (x1 - x2) returns the negative of the correct slope.
- Mixing up zero slope and undefined slope. A horizontal line has zero slope (m = 0, because the vertical change is 0). A vertical line has undefined slope (the horizontal change is 0, so the division is impossible).
- Treating slope as an angle. Slope is the tangent of the angle with the positive x-axis. A slope of 1 is 45°, but a slope of 2 is about 63.4°, not 90°.
- Judging steepness by eye on charts with different axis scales. A slope of 10 can look gentler than a slope of 2 if the y-axis is compressed.
Practical Applications📊
Roofing and drainage: a 4:12 roof pitch is a slope of 4/12 ≈ 0.333. The International Plumbing Code (Section 704.1) sets a typical minimum of 1/4 inch per foot for small horizontal drain pipes, which is a slope of about 0.0208.
Ramps and roads: the ADA 2010 Standards (Section 405.2) cap the running slope of an accessible ramp at 1:12, or 8.33%. A 6% road grade means a slope of 0.06, which is 6 m of rise per 100 m of horizontal distance.
Physics and data analysis: on a position-time graph, slope is velocity. A car moving from 20 m to 80 m in 4 s has a slope of 60/4 = 15 m/s. In linear regression, a slope of 2.5 points per hour of study means each extra hour adds 2.5 points to the predicted score.
Geometry: parallel lines share the same slope, and perpendicular lines have slopes whose product is -1. A line with slope 3 is perpendicular to a line with slope -1/3.
