Equation of a line through two points calculator
Two different points determine exactly one line. The calculator writes it in the slope-intercept form y = mx + b. The slope (gradient) m tells you how far the line rises when you move one unit to the right, and the y-intercept b is where the line crosses the y-axis.
If both points have the same x-coordinate, the line is vertical. It has no slope, and its equation is simply x = x1.
How it works
The calculator works out the slope and the y-intercept using these formulas:
For points A(1, 3) and B(4, 9), first work out the slope. From A to B we move 3 to the right and 6 up:
Work out the y-intercept b from either point, for example A. Substitute into y = mx + b:
The equation of the line is y = 2x + 1. Check with point B: 2 · 4 + 1 = 9. It works. Other ways of writing a line are described in the article on lines.
Chapters: Quadratic equation calculator, Linear equation calculator, Simultaneous equations calculator, Distance between two points calculator, Midpoint of a line segment calculator, Equation of a line through two points calculator, Rounding calculator, Standard form calculator, Mixed number and fraction calculator