Line Equation from Two Points Calculator

Find the equation of a line passing through two points in 2D or 3D space

Line Equation Calculator

First Point

Second Point

Invalid Input

Please ensure that the two points are different. Identical points cannot define a unique line.

Example: Line Through (1,1) and (3,5)

Given Points

Point 1: (1, 1)
Point 2: (3, 5)

Step-by-Step Solution

Step 1: Calculate slope: m = (y₂ - y₁) / (x₂ - x₁) = (5 - 1) / (3 - 1) = 4/2 = 2

Step 2: Calculate y-intercept: b = y₁ - m × x₁ = 1 - 2 × 1 = -1

Step 3: Write equation: y = 2x - 1

Line Equation Forms

SI

Slope-Intercept

y = mx + b

Most common form

SF

Standard Form

Ax + By + C = 0

Integer coefficients

TP

Two-Point Form

(y - y₁) = m(x - x₁)

Direct from points

Key Formulas

Slope (2D):
m = (y₂ - y₁) / (x₂ - x₁)
Y-Intercept:
b = y₁ - m × x₁
Distance (2D):
d = √[(x₂-x₁)² + (y₂-y₁)²]
Distance (3D):
d = √[(x₂-x₁)² + (y₂-y₁)² + (z₂-z₁)²]

Tips

Vertical lines have undefined slope

Horizontal lines have zero slope

Parallel lines have equal slopes

Perpendicular lines have negative reciprocal slopes

Understanding Line Equations from Two Points

2D Line Equations

Given two points (x₁, y₁) and (x₂, y₂), there exists a unique line passing through both points. This line can be expressed in several mathematical forms.

Slope-Intercept Form

The slope-intercept form y = mx + b is the most commonly used form where:

  • m is the slope: (y₂ - y₁) / (x₂ - x₁)
  • b is the y-intercept: y₁ - m × x₁

Standard Form

The standard form Ax + By + C = 0 where:

  • A = y₂ - y₁
  • B = x₁ - x₂
  • C = y₁(x₂ - x₁) - (y₂ - y₁)x₁

3D Line Equations

In 3D space, a line is defined using parametric equations or vector form since traditional y = mx + b doesn't extend to three dimensions.

Vector Form

The vector form expresses the line as: (x, y, z) = t⃗v + P₁

  • ⃗v is the direction vector [x₂-x₁, y₂-y₁, z₂-z₁]
  • P₁ is one of the given points
  • t is a parameter that varies

Applications

  • Computer graphics and 3D modeling
  • Engineering design and CAD systems
  • Physics simulations and trajectories
  • Navigation and GPS systems