# Equation of Straight Line in Plane/Two-Point Form

## Theorem

Let $p_1 := \tuple {x_1, y_1}$ and $p_2 := \tuple {x_2, y_2}$ be points in a cartesian plane.

Let $\LL$ be the straight line passing through $p_1$ and $p_2$.

Then $\LL$ can be described by the equation:

$\dfrac {y - y_1} {x - x_1} = \dfrac {y_2 - y_1} {x_2 - x_1}$

or:

$\dfrac {x - x_1} {x_2 - x_1} = \dfrac {y - y_1} {y_2 - y_1}$

## Proof

From the slope-intercept form of the equation of the straight line:

$(1): \quad y = m x + c$

which is to be satisfied by both $\tuple {x_1, y_1}$ and $\tuple {x_2, y_2}$.

We express $m$ and $c$ in terms of $\paren {x_1, y_1}$ and $\paren {x_2, y_2}$:

 $\displaystyle y_1$ $=$ $\displaystyle m x_1 + c$ $\displaystyle y_2$ $=$ $\displaystyle m x_2 + c$ $\displaystyle \leadsto \ \$ $\displaystyle c$ $=$ $\displaystyle y_1 - m x_1$ $\displaystyle \leadsto \ \$ $\displaystyle y_2$ $=$ $\displaystyle m x_2 + y_1 - m x_1$ $\text {(2)}: \quad$ $\displaystyle \leadsto \ \$ $\displaystyle m$ $=$ $\displaystyle \dfrac {y_2 - y_1} {x_2 - x_1}$

 $\displaystyle y_1$ $=$ $\displaystyle m x_1 + c$ $\displaystyle y_2$ $=$ $\displaystyle m x_2 + c$ $\displaystyle \leadsto \ \$ $\displaystyle m$ $=$ $\displaystyle \dfrac {y_2 - c} {x_2}$ $\displaystyle \leadsto \ \$ $\displaystyle y_1$ $=$ $\displaystyle \dfrac {y_2 - c} {x_2} x_1 + c$ $\displaystyle \leadsto \ \$ $\displaystyle y_1 x_2$ $=$ $\displaystyle x_1 y_2 + c \paren {x_2 - x_1}$ $\text {(3)}: \quad$ $\displaystyle \leadsto \ \$ $\displaystyle c$ $=$ $\displaystyle \dfrac {y_1 x_2 - x_1 y_2} {x_2 - x_1}$

Substituting for $m$ and $c$ in $(1)$:

 $\displaystyle y$ $=$ $\displaystyle m x + c$ which is $(1)$ $\displaystyle \leadsto \ \$ $\displaystyle y$ $=$ $\displaystyle \dfrac {y_2 - y_1} {x_2 - x_1} x + \dfrac {y_1 x_2 - x_1 y_2} {x_2 - x_1}$ from $(2)$ and $(3)$ $\displaystyle \leadsto \ \$ $\displaystyle y \paren {x_2 - x_1} + x_1 y_2$ $=$ $\displaystyle x \paren {y_2 - y_1} + y_1 x_2$ $\displaystyle \leadsto \ \$ $\displaystyle y \paren {x_2 - x_1} + x_1 y_2 - y_1 x_1$ $=$ $\displaystyle x \paren {y_2 - y_1} + y_1 x_2 - x_1 y_1$ adding $y_1 x_1 = x_1 y_1$ to both sides $\displaystyle \leadsto \ \$ $\displaystyle y \paren {x_2 - x_1} - y_1 \paren {x_2 - x_1}$ $=$ $\displaystyle x \paren {y_2 - y_1} - x_1 \paren {y_2 - y_1}$ $\displaystyle \leadsto \ \$ $\displaystyle \paren {y - y_1} \paren {x_2 - x_1}$ $=$ $\displaystyle \paren {x - x_1} \paren {y_2 - y_1}$ $\displaystyle \leadsto \ \$ $\displaystyle \dfrac {y - y_1} {x - x_1}$ $=$ $\displaystyle \dfrac {y_2 - y_1} {x_2 - x_1}$ $\displaystyle \leadsto \ \$ $\displaystyle \dfrac {x - x_1} {x_2 - x_1}$ $=$ $\displaystyle \dfrac {y - y_1} {y_2 - y_1}$

$\blacksquare$