# Line Equation from Two Points Calculator

Created by Anna Szczepanek, PhD
Reviewed by Rijk de Wet
Last updated: Jun 05, 2023

This line equation from two points calculator will help you write down the equation of a line passing through any pair of points. Scroll down to find an article explaining how to determine the slope-intercept linear equation as well as the standard form linear equation from any two points in 2D space. We will also teach you how to find the 3D line equation from two points!

Of course, we provide all the formulas in case you have to solve such a problem by hand. In such a case, don't forget to check your solution with Omni's line equation from two points calculator!

🙋 Check out our slope intercept form calculator if you're not yet familiar with this type of equation.

## What is the linear equation from two points?

The linear equation from two points (x1, y1) and (x2, y2) describes the unique line that passes through these points. This equation can be in the standard form (Ax + By + C = 0) or in the slope-intercept form (y = ax + b). A unique line equation also exists for any two points in three-dimensional space.

In what follows, we discuss how to determine the line equation from two points — first in the slope-intercept form and then in the standard form. Then we will move on to 3D space.

## How do I find the slope-intercept line equation from two points?

To compute the equation of the line passing through points (x1, y1) and (x2, y2):

1. Compute the slope as a = (y2-y1) / (x2-x1).
2. Compute the intercept as b = y1 - a × x1.
3. The equation you need reads y = a × x + b, with a an b computed as above.
4. If x2 = x1, you cannot compute a — the line is vertical and has equation x = x1.

💡 Does the slope formula from Step 1 remind you of the rise over run formula? This is not an accident! Discover more with our rise over run calculator.

## How do I compute the standard form linear equation from two points?

To compute the standard form equation of the line passing through (x1, y1) and (x2, y2):

1. Compute A = y2 - y1.
2. Compute B = x1 - x2.
3. Finally, compute C = y1 × (x2 - x1) - (y2 - y1) × x1.
4. The standard form linear equation from two points is Ax + By + C = 0 with A, B, and C as above.

## 3D line equation from two points

The equation of the line passing through points (x1, y1, z1) and (x2, y2, z2) is:

(x, y, z) = v × t + point

where:

• v – Directional vector computed as v = [x2-x1, y2-y1, z2-z1];
• t – A real parameter; and
• point – One of the two points we're given.

See our direction of the vector calculator for more information on v here.

Explicitly, the 3D line equation from two points reads:

(x, y, z) = [x2-x1, y2-y1, z2-z1] × t + (x1, y1, z1)

We can rewrite this as the system of equations for each coordinate:

x = (x2 - x1) × t + x1
y = (y2 - y1) × t + y1
z = (z2 - z1) × t + z1

## How to use this line equation from two points calculator?

Omni's line equation from two points calculator is really straightforward to use! Follow these steps:

1. First, tell us what dimension your problem sits in: 2D or 3D.

2. Enter the coefficients of the points in respective fields.

3. Our tool determines the linear equation immediately and displays it at the bottom of the calculator:

• For 2D problems: it shows the slope-intercept equation and standard form equation.

• For 3D problems: it shows the parametric equation, both in vector form and as a system of equations.

4. You can adjust the precision of calculations by clicking the advanced mode and changing the value of the variable Precision.

## FAQ

### What is the two point form formula?

Two point form formula is a way of writing down the equation of a line passing through two points. If the points are (x1, y1) and (x2, y2), then the two-point form reads:

y - y1 = (y2 - y1)/(x2 - x1) × (x - x1).

### What is the equation of a line passing through (1,1) and (3,5)?

This equation is y = 2x - 1. To arrive at this answer, we find the slope as follows:

a = (y2 - y1) / (x2 - x1) = (5-1) / (3-1) = 4/2 = 2

Then we find the intercept as b = y1 - a × x1 = 1 - 2 × 1 = -1. So the equation reads y = a × x + b = 2x - 1, as claimed.

Anna Szczepanek, PhD
Choose dimension
2D
First point
x₁
y₁
Second point
x₂
y₂
Line equation
People also viewed…

### Area of a rectangle

Area of a rectangle calculator finds the area, perimeter, and diagonal of a rectangle.

### Black hole collision

The Black Hole Collision Calculator lets you see the effects of a black hole collision, as well as revealing some of the mysteries of black holes, come on in and enjoy!

### Body fat

Use our free Body Fat Calculator, based on BMI, to determine your body fat percentage and explore your ideal body fat range.

### Volume of a parallelepiped

This volume of a parallelepiped calculator can compute a parallelepiped's volume and surface area from its three vectors, vertices, or edge lengths.