Formula and Method for Triangle Slope
A "slope triangle" is the right triangle formed underneath a line segment when you drop a vertical leg (the rise) and a horizontal leg (the run) between two points. Its legs let you compute the line's slope directly from coordinates: m = Δy / Δx = (y₂ - y₁) / (x₂ - x₁). This calculator takes two points, builds that right triangle, and reports the slope, the angle the line makes with the horizontal, the length of the hypotenuse (the straight-line distance between the points), and the line's slope-intercept equation.
How the calculation works
Enter the coordinates of two points. The calculator finds the horizontal leg (run = x₂ - x₁) and vertical leg (rise = y₂ - y₁) of the slope triangle, then divides rise by run to get the slope m. The angle of inclination comes from θ = arctan(m), giving the angle in degrees between the line and the positive x-axis. The Pythagorean theorem, h = √(run² + rise²), gives the hypotenuse — the straight-line distance between the two points. Finally, the y-intercept b = y₁ - m·x₁ completes the equation y = mx + b.
Common mistakes
- Reversing the order of subtraction: rise and run must use the same point order — (y₂-y₁) over (x₂-x₁), not (y₁-y₂) over (x₂-x₁). Swapping only one flips the sign of the slope.
- Vertical lines: if the two points share the same x-coordinate, run = 0 and the slope is undefined (a vertical line has no finite slope).
- Confusing slope with angle: a slope of 1 means a 45° angle, but a slope of 2 is about 63.4°, not 90° — the relationship is arctan, not linear.
Real-world applications
- Road grades, ramps, and roof pitches are expressed as slope (rise over run) or as a percentage grade.
- Physics and engineering use the angle of inclination to resolve forces along an incline.
- Coordinate geometry uses slope to test whether lines are parallel (equal slopes) or perpendicular (negative reciprocal slopes).
- Surveying and construction use the hypotenuse length to lay out diagonal braces, stringers, or sightlines between two known points.