Welcome to our Line Equation from Two Points Calculator page.
We explain how to find the equation of a line given two points and provide a quick calculator to work it out for you, step-by-step.
We also have some worked examples and some worksheets for you to practice this skill.
Quicklinks to ...
This calculator finds the equation of a line given the coordinates of two different points on the line.
This is also called finding the linear equation from two points.
A linear equation (or line equation) is an equation of a straight line.
A linear equation can be written in the standard form:
Ax + By + C = 0
However, it is more commonly written in slope-intercept form:
y = mx + c
In a linear equation, as one variable goes up (or down) the other variable changes at a steady, constant rate.
The equation of a line we are going to use is:
\[ y = mx + c \]
The steps for finding the line equation from two points are as follows:
The gradient of the line - which is how steep or shallow the line is - can be found using the formula:
\[ m = {(y_2 - y_1) \over (x_2 - x_1)} \]
where the two points on the line are (x1, y1) and (x2, y2)
Find the equation of the straight line which passes through (1, -2) and (4, 7).
The equation of the line we are looking for is:
\[ y = mx + c \]
Step 1) Find the gradient m
The equation to find the gradient is:
\[ m = {(y_2 - y_1) \over (x_2 - x_1)} \]
Our two points are (1, -2) and (4,7) so this give us:
This gives us:
\[ m = {(7 - (-2)) \over (4 - 1)} = {9 \over 3} = 3 \]
This means that:
\[ y = 3x + c \]
Step 2) Find the value of c
\[ If \; y = 3x + c \; then \; c = y - 3x \]
We need to take the values from one of the two coordinates and substitute these into the equation to find c.
\[ c = y - 3x \]
The first coordinate is (1, -2) so we will use this one. So we have x is 1 and y is -2.
Substituting these values gives us:
\[ c = (-2) - 3(1) = (-2) - 3 = -5 \]
So our final answer is y = 3x - 5.
Check the Equation of the line is correct
A useful way to check if this answer is correct is to use the second coordinate (4, 7).
With the second coordinate the x value is 4 and the y value is 7.
If we substitute the x value into the equation we have just found it should give the correct y value. If it does then the equation is correct.
\[ y = 3x - 5 = 3(4) - 5 = 12 - 5 = 7\]
So the equation works for the second coordinate which means that our check worked.
Find the equation of the straight line which passes through (1, 5 ½) and (6, -2). Give your answer in standard form ax + by + c = 0.
The equation of the line we are looking for is:
\[ y = mx + c \]
Step 1) Find the gradient m
The equation to find the gradient is:
\[ m = {(y_2 - y_1) \over (x_2 - x_1)} \]
Our two points are (1, 5 ½) and (6, -2) so this give us:
This gives us:
\[ m = {(-2 - 5 {1 \over 2}) \over (6 - 1)} = {-{4 \over 2} - {11 \over 2} \over 5} = {{-15 \over 2} \over 5} = -{15 \over 10} = -{3 \over 2} \]
This means that:
\[ y = -{3 \over 2}x + c \]
Step 2) Find the value of c
\[ y = -{3 \over 2}x + c \; then \; c = y + {3 \over 2}x \]
We need to take the values from one of the two coordinates and substitute these into the equation to find c.
\[ c = y + {3 \over 2}x \]
The first coordinate is (1, 5 ½) so we will use this one. So we have x is 1 and y is 5 ½.
Substituting these values gives us:
\[ c = 5 {1 \over 2} + {3 \over 2}(1) = {11 \over 2} + {3 \over 2} = {14 \over 2} = 7 \]
So the equation of the line is:
\[ y = -{3 \over 2}x + 7 \; or \]
\[ y = 7 - {3 \over 2}x \]
However, this is not yet in standard form of ax + by + c = 0
We now need to rearrange the equation with all the x, y and c parts on the left side of the equation and 0 on the right side.
\[ y = 7 - {3 \over 2}x \]
Subtract 7 from both sides gives:
\[ y - 7 = -{3 \over 2}x \]
Now add the x coefficient to both sides gives:
\[ y - 7 + {3 \over 2}x = 0 \]
Reaarange the variables so the x term comes first, then the y term
\[ {3 \over 2}x + y - 7 = 0 \]
We can multiple both sides of the equation by 2 to give an integer solution:
This gives us a final answer in standard form of: \[ 3x + 2y - 14 = 0 \]
Take a look at some more of our worksheets similar to these.
If you are needing help with finding the slope of a linear equation, or want a quick way to calculate the slope then check out this page below.
On the page you will find:
If you need further support on solving linear equations, then try our dedicated support page.
On the page you will find:
We have a range of other calculators with step by step working out to support you..
These calculators cover a range of different areas and volumes of 2d and 3d shapes
These calculators help you to learn and work out fraction addition, subtraction, multiplication and division.
These calculators cover percentages of numbers, percentage increase and decrease and reverse percentages.
We have a wide range of free math calculators to help you.
Most of our calculators show you their working out so that you can see exactly what they have done to get the answer.
Our calculator hub page contains links to all of our calculators!
How to Print or Save these sheets 🖶
Need help with printing or saving?
Follow these 3 steps to get your worksheets printed perfectly!
How to Print or Save these sheets 🖶
Need help with printing or saving?
Follow these 3 steps to get your worksheets printed perfectly!
Sign up for our newsletter to get free math support delivered to your inbox each month. Plus, get a seasonal math grab pack included for free!
Return to Calculators Hub page
Return from Line Equation from Two Points Calculator to Math Salamanders Homepage
The Math Salamanders hope you enjoy using these free printable Math worksheets and all our other Math games and resources.
If you have any questions or need any information about our site, please get in touch with us using the 'Contact Us' tab at the top and bottom of every page.