Line Equation from Two Points Calculator

Find the equation of a line passing through two points in slope-intercept, point-slope, and standard forms.

Enter Two Points

Result

Slope-Intercept Form
--
Slope (m) --
Y-Intercept (b) --
Point-Slope Form --
Standard Form (Ax + By = C) --
X-Intercept --

Step-by-Step Solution

m = (y2 - y1) / (x2 - x1)

Finding the Equation of a Line from Two Points

One of the most fundamental tasks in algebra and coordinate geometry is determining the equation of a line given two points. The line equation tells you the relationship between x and y for every point on the line, and there are several standard ways to express it.

Forms of a Line Equation

Slope-Intercept Form

The most commonly used form, showing slope and y-intercept directly.

y = mx + b

Point-Slope Form

Useful when you know a point and the slope.

y - y1 = m(x - x1)

Standard Form

Integer coefficients with A being positive.

Ax + By = C

How to Find the Equation

  1. Calculate the slope: m = (y2 - y1) / (x2 - x1). The slope tells you the rate of change and the steepness of the line.
  2. Find the y-intercept: Substitute one point and the slope into y = mx + b, then solve for b.
  3. Write the equation: Plug m and b back into y = mx + b for the slope-intercept form.
  4. Convert to other forms: Rearrange to get point-slope or standard form as needed.

Special Cases

  • Horizontal line: When y1 = y2, the slope is 0 and the equation is y = y1.
  • Vertical line: When x1 = x2, the slope is undefined and the equation is x = x1.
  • Line through origin: When the y-intercept b = 0, the equation simplifies to y = mx.

Applications

Finding line equations is essential in physics (linear motion), economics (supply and demand curves), statistics (linear regression), engineering (calibration curves), and computer graphics (line drawing algorithms). Understanding how to derive these equations is a foundational skill for more advanced topics like systems of equations and linear algebra.