Calculate Line Through Two Points

Line through two points generic

This example shows how to calculate the equation of the line that passes through two points. The general slope equation for a line is shown below where and are constants.

To find the equation of the line that passes through two points you first calculate the slope of the line by calculating the change in over the change in . Then, using the slope of the line, solve for the line’s -intercept using one of the two points. This gives the equation of the line in standard form:

Process

  1. Set up the slope equation for a line.

  2. Calculate the slope of the line by calculating the change in over the change in for two points on the line.

  3. Use the slope and one of the points to solve for the constant . Start subtracting from both sides to rearrange the equation so that is on one side.

    Substitute the calculated slope and the coordinates of one of the points into the equation.

  4. Finally, substitute the calculated value for and into the original equation

Examples

Example 1

Equation of line through points (3,2) and (6,3)

This example demonstrates how to find the equation of the line through the points and .

Steps

  1. Set up the slope equation for a line.

  2. Calculate the slope of the line by calculating the change in over the change in for two points on the line.

  3. Use the slope and one of the points to solve for the -intercept of the line represented by the constant . Subtract from both sides and rearrange the equation so that is on one side.

    Substitute the calculated slope and the coordinates of one of the points into the equation. In this case, substitute the coordinate of the first point .

  4. Finally, substitute the calculated value for and into the original equation

    The equation of the line that passes through the two points and is given by the equation shown in the line above.

Example 2

Equation of line through points (0,-1) and (3,1)

This example demonstrates how to find the equation of the line through the points and .

Steps

  1. Set up the slope equation for a line.

  2. Calculate the slope of the line by calculating the change in over the change in for two points on the line.

  3. Use the slope and one of the points to solve for the -intercept of the line represented by the constant . Subtract from both sides and rearrange the equation so that is on one side.

    Substitute the calculated slope and the coordinates of one of the points into the equation. In this case, substitute the coordinate of the second point .

    You could also observe that we already know the value of to be since we know the point where the line crosses the axis is .

  4. Finally, substitute the calculated value for and into the original equation

    The equation of the line that passes through the two points and is given by the equation shown in the line above.

Example 3

Equation of line through points (-1,2) and (1,0)

This example demonstrates how to find the equation of the line through the points and .

Steps

  1. Set up the slope equation for a line.

  2. Calculate the slope of the line by calculating the change in over the change in for two points on the line.

  3. Use the slope and one of the points to solve for the -intercept of the line represented by the constant . Subtract from both sides and rearrange the equation so that is on one side.

    Substitute the calculated slope and the coordinates of one of the points into the equation. In this case, substitute the coordinate of the second point .

  4. Finally, substitute the calculated value for and into the original equation

    The equation of the line that passes through the two points and is given by the equation shown in the line above.