Enter the coordinates of two points (x₁, y₁) and (x₂, y₂). Everything updates as you type, including vertical and horizontal lines.
The slope is rise over run: m = (y₂ − y₁) ÷ (x₂ − x₁). From (1, 2) to (4, 8) the line rises 6 and runs 3, so m = 2. A positive slope climbs from left to right, a negative slope falls, zero is flat, and a vertical line (run of 0) has an undefined slope.
The distance between the points comes from Pythagoras: d = √((x₂ − x₁)² + (y₂ − y₁)²). For the same points, d = √(3² + 6²) = √45 ≈ 6.708. The midpoint is the average of each coordinate: ((x₁ + x₂) ÷ 2, (y₁ + y₂) ÷ 2) = (2.5, 5).
The line through both points is written y = mx + b, where b is the y-intercept found from b = y₁ − m·x₁. Standard form Ax + By = C uses whole numbers where possible, and the angle to the x-axis is arctan(m).
Subtract the y-values and divide by the difference in x-values, in the same order: m = (y₂ − y₁) / (x₂ − x₁). It doesn’t matter which point you call first, as long as you are consistent.
It means the two points share the same x-value, so the line is vertical and the run is zero. Its equation is simply x = (that value).
Work out the slope m, then substitute one point into y = mx + b to find b. For (1, 2) and (4, 8): m = 2, so 2 = 2 × 1 + b and b = 0, giving y = 2x.
d = √((x₂ − x₁)² + (y₂ − y₁)²). It is Pythagoras’ theorem applied to the horizontal and vertical gaps between the points.
Angle = arctan(slope), in degrees. Percentage grade = slope × 100, so a slope of 0.05 is a 5% grade, about 2.9°.