Two points determine a unique line. Finding its equation is a basic skill for graphing, physics (position–time graphs) and data modelling.
How to use the Line Equation from Two Points Calculator
- Dimension
- x₁
- y₁
- z₁
- x₂
- y₂
- z₂
Everything is calculated in your browser, so results appear instantly and nothing you type is sent to a server.
How it works
The slope comes from the two points; the intercept from substituting one of them. Integer standard-form coefficients are found by clearing fractions. In 3D the direction vector is the difference of the points.
Formula
m = (y₂ − y₁)/(x₂ − x₁), b = y₁ − m·x₁
Standard: (y₂ − y₁)x + (x₁ − x₂)y = (y₂ − y₁)x₁ + (x₁ − x₂)y₁
Worked example
Inputs — Dimension: 2D; x₁: 1; y₁: 2; x₂: 3; y₂: 7.
Results — Line equation = y = (5/2)x − 1/2; Standard form / components = 5x − 2y = 1; Slope = 5/2 ≈ 2.5; y-intercept = −1/2; Point-slope / symmetric form = y − 2 = (5/2)(x − 1).
Key terms
- Slope-intercept form
- y = mx + b.
Frequently asked questions
How do I find a line from two points?
Find the slope, then substitute one point into y = mx + b to get b.
What if the x-coordinates are equal?
The line is vertical: x = constant.
What is standard form?
Ax + By = C with integers and A ≥ 0.
How do I describe a line in 3D?
With a point and a direction vector: (x, y, z) = P + t·d.