How it is calculated
- Slope m = (y₂ − y₁) ÷ (x₂ − x₁)
- y-intercept b = y₁ − m × x₁, giving the line y = mx + b
- Angle = the arctangent of m, in degrees
- Distance = √((x₂ − x₁)² + (y₂ − y₁)²)
- Midpoint = ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2)
For the sides of a right triangle, use the Pythagorean theorem calculator. For other maths, use the scientific calculator.
Worked example
The points (1, 2) and (3, 6):
- Slope: (6 − 2) ÷ (3 − 1) = 2
- Intercept: 2 − 2 × 1 = 0, so the line is y = 2x
- Angle: arctan(2) = 63.43°
- Distance: √(4 + 16) = 4.4721, and the midpoint is (2, 4)
Why your number may differ
Results are rounded to four decimal places, and the equation to six. The slope of a road or roof is often given as a percentage, which is the slope times 100.