How it works
Two points give m = (y₂ − y₁)/(x₂ − x₁), then b = y₁ − mx₁. Point-and-slope mode gives b = y − mx; slope-and-intercept mode uses y = mx + b directly.
Identical points cannot define a unique line. Vertical lines return x = constant rather than dividing by zero.
Worked example
The line through (1, 3) and (3, 7) has a slope of 2 and a y-intercept of 1, so its equation is y = 2x + 1.
Cite this page
ToolOctopus. “Equation of a line calculator.” Updated . https://tooloctopus.com/equation-of-a-line-calculator.
Add an access date if your instructions require one.
Citation formatting uses citeproc-js by Frank Bennett and Citation Style Language styles. License and source code.