Line Equation from Two Points Calculator

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.

Line Equation from Two Points Calculator

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.

Line Equation from Two Points Calculator

linear equation with two points calculator image 1


Answer


Answer

Answer

 
 


How to use our Line Equation From Two Points Calculator

  1. Choose values for the 2 coordinates on the line that you want to find the equation for.
  2. Type in the two values for each coordinate (x1, y1) and (x2, y2).
  3. You do not need to use brackets to type the coordinates, you just need to input the values of each coordinate in turn.
  4. Values can be given in fraction, decimal, mixed numbers, integer form:
    • You can type a fraction by typing the numerator then '/' then the denominator.
    • You can type a mixed number by typing the whole-number part, then a space then the fraction part.
    • Examples: 2 1/2 (two and one-half); 3 4/5 (three and four-fifths); 7 1/3 (seven and one-third), -4 1/2 (negative four and one-half).
    • You can type a decimal or negative number, such as 0.7 or -3.2
  5. Choose your desired accuracy (default is 2 decimal places)
  6. Click the Get Equation button
  7. You will be shown the equation of the line, both as a fraction and a decimal (where appropriate).
  8. The equation is shown both as a slope-intercept form (y = mx + c) and standard form (ax + by + c = 0)
  9. The working out will be shown below so that you can see how the equation has been derived.

What is a Linear Equation?

Standard Form

linear equation standard form image

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

  • where A, B and C are whole numbers
  • x and y are variables

Slope-Intercept Form

linear equation slope-intercept form image

However, it is more commonly written in slope-intercept form:

y = mx + c

  • m is the gradient or slope of the line
  • x is the x coordinate and y is the y coordinate
  • the point c is the y intercept where the line crosses the y-axis.

In a linear equation, as one variable goes up (or down) the other variable changes at a steady, constant rate.

Steps to find a Linear Equation from Two Points

Steps to finding the equation of a line from two points

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:

  1. Find the value of m (the gradient or slope of the line)
  2. Substitute the value of one of the two points on the line into the equation to find the value of c (the y-intercept).
  3. Once you know m and c you have found the equation of the line y = mx + c

How to find the Gradient (m)

Formula for finding the gradient m

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)

Line Equation from Two Points Examples


Linear Equation with two points Example 1

Find the equation of the straight line which passes through (1, -2) and (4, 7).

linear equation with two points example 1

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:

  • x1 = 1
  • y1 = -2
  • x2 = 4
  • y2 = 7

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.

 

Linear Equation with two points Example 2

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.

linear equation with two points example 2

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:

  • x1 = 1
  • y1 =5 ½
  • x2 = 6
  • y2 = -2

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 \]

More Recommended Math Worksheets

Take a look at some more of our worksheets similar to these.

Slope of a Linear Equation Support

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:

  • clear definitions and explanations how to find the slope of a linear equation
  • find the slope from a linear equation, from two points, or from a line on a coordinate grid
  • lots of worked examples
  • practice worksheets

Linear Equation with Two Points Support

If you need further support on solving linear equations, then try our dedicated support page.

On the page you will find:

  • clear definitions and explanations how to find a linear equation from two points
  • lots of worked examples
  • practice worksheets

More Related Algebra Calculators

We have a range of other calculators with step by step working out to support you..

Looking for more math calculators?

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!

Subscribe to Math Salamanders News

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!

Math-Salamanders.com

Math Salamanders Main Logo

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.


Share this page