Line Calculator
Find the equation of a line step by step
This calculator will find the equation of a line (in the slope-intercept, point-slope, and general forms) given two points or the slope and one point, with steps shown.
Related calculators: Slope Calculator, Parallel and Perpendicular Line Calculator
Solution
Your input: find the equation of a line given two points $$$P=\left(1, 2\right)$$$ and $$$Q=\left(3, 10\right)$$$.
The slope of a line passing through the two points `P=(x_1, y_1)` and `Q=(x_2, y_2)` is given by `m=(y_2-y_1)/(x_2-x_1)`.
We have that $$$x_1=1$$$, $$$y_1=2$$$, $$$x_2=3$$$, $$$y_2=10$$$.
Plug the given values into the formula for slope: $$$m=\frac{\left(10\right)-\left(2\right)}{\left(3\right)-\left(1\right)}=\frac{8}{2}=4$$$.
Now, the y-intercept is `b=y_1-m*x_1` (or `b=y_2-m*x_2`, the result is the same).
$$$b=2-\left(4\right) \cdot \left(1\right)=-2$$$.
Finally, the equation of the line can be written in the form `y=mx+b`.
$$$y=4x-2$$$.
Answer:
The slope of the line is $$$m=4$$$.
The equation of the line in the slope-intercept form is $$$y=4x-2$$$.
The equation of the line in the point-slope form is $$$y - 2 = 4 \left(x - 1\right)$$$.
The equation of the line in the point-slope form is $$$y - 10 = 4 \left(x - 3\right)$$$.
The general equation of the line is $$$4 x - y - 2 = 0$$$.