Find the slope, angle and line equation through two points.
Slope is rise over run: how many units y changes for every one unit increase in x. Given two points (x₁, y₁) and (x₂, y₂), slope m = (y₂−y₁)/(x₂−x₁). A positive slope rises left to right; negative falls. A zero slope is horizontal; an undefined slope is a vertical line. The slope-intercept form y = mx + b describes the full line where b is the y-value when x = 0.
Slope
m = (y₂ − y₁) / (x₂ − x₁)
Slope-intercept form
y = mx + b where b = y₁ − m·x₁
Distance
distance = √((x₂−x₁)² + (y₂−y₁)²)
A slope of undefined means the line is perfectly vertical: x₁ = x₂. Run (Δx) = 0, and dividing by zero is undefined. The equation of such a line is x = constant.
The y-intercept b is the value of y where the line crosses the y-axis (i.e., when x = 0). It is calculated as b = y₁ − m·x₁.
Rearrange to y = mx + b form. The coefficient of x is the slope m. For example, 2x − y + 3 = 0 rearranges to y = 2x + 3, so the slope is 2.