# Equation of Line passing through Two given Points

## Equation of Line passing through Two given Points

Vector Form:

From the figure, $$\overrightarrow{OP}\,=\,\overrightarrow{r},\,\overrightarrow{OA}\,=\,\overrightarrow{a}$$ and $$\overrightarrow{OB}\,=\,\overrightarrow{b}$$.

Since $$\overrightarrow{AP}$$ is collinear with $$\overrightarrow{AB}$$, $$\overrightarrow{AP}\,=\,\lambda \,\overrightarrow{AB}$$ for some scalar λ, we have

$$\overrightarrow{OP}\,-\,\overrightarrow{OA}\,=\,\lambda \,\left( \overrightarrow{OB}\,-\,\overrightarrow{OA} \right)$$.

or $$\overrightarrow{r}\,-\,\overrightarrow{a}\,=\,\lambda \,\left( \overrightarrow{b}\,-\,\overrightarrow{a} \right)$$.

or $$\overrightarrow{r}\,=\,\overrightarrow{a}\,+\,\lambda \,\left( \overrightarrow{b}\,-\,\overrightarrow{a} \right)$$ … (i)

Therefore, the equation of a straight line passing through $$\overrightarrow{a}$$ and $$\overrightarrow{b}$$ is $$\overrightarrow{r}\,=\,\overrightarrow{a}\,+\,\lambda \,\left( \overrightarrow{b}\,-\,\overrightarrow{a} \right)$$.

Cartesian Form:

We have $$\overrightarrow{r}\,=\,x\hat{i}\,+\,y\hat{j}\,+\,z\hat{k},\,\overrightarrow{a}\,=\,{{x}_{1}}\hat{i}\,+\,{{y}_{1}}\hat{j}\,+\,{{z}_{1}}\hat{k}$$ and $$\,\overrightarrow{r}\,=\,{{x}_{2}}\hat{i}\,+\,{{y}_{2}}\hat{j}\,+\,{{z}_{2}}\hat{k}$$.

Substituting these values in (i), we get

$$x\hat{i}\,+\,y\hat{j}\,+\,z\hat{k}\,=\,{{x}_{1}}\hat{i}\,+\,{{y}_{1}}\hat{j}\,+\,{{z}_{1}}\hat{k}\,+\,\lambda \left[ \left( {{x}_{2}}\,-\,{{x}_{1}} \right)\hat{i}\,+\,\left( {{y}_{2}}\,-\,{{y}_{1}} \right)\hat{j}\,+\,\left( {{z}_{2}}\,-\,{{z}_{1}} \right)\hat{k} \right]$$.

Equating the coefficients of $$\hat{i}$$, $$\hat{j}$$ and $$\hat{k}$$, we get

$$x\,=\,{{x}_{1}}\,+\,\lambda \,\left( {{x}_{2}}\,-\,{{x}_{1}} \right)$$; $$y\,=\,{{y}_{1}}\,+\,\lambda \,\left( {{y}_{2}}\,-\,{{y}_{1}} \right)$$; $$z\,=\,{{z}_{1}}\,+\,\lambda \,\left( {{z}_{2}}\,-\,{{z}_{1}} \right)$$.

On eliminating λ, we obtain $$\frac{x\,-\,{{x}_{1}}}{{{x}_{2}}\,-\,{{x}_{1}}}\,=\,\frac{y\,-\,{{y}_{1}}}{{{y}_{2}}\,-\,{{y}_{1}}}\,=\,\frac{z\,-\,{{z}_{1}}}{{{z}_{2}}\,-\,{{z}_{1}}}\,=\,\lambda$$.

which is the equation of the line in Cartesian form.

Example: The Cartesian equation of a line is $$\frac{x-3}{2}=\frac{y+1}{-2}=\frac{z-3}{5}$$. Find the vector equation of the line

Solution: Given that $$\frac{x-3}{2}=\frac{y+1}{-2}=\frac{z-3}{5}$$.

Note that it passes through (3, -1, 3) and

Is parallel to the line whose direction ratios are 2, -2, and 5.

Therefore, its vector equation is $$\overrightarrow{r}=3\hat{i}-\hat{j}+3\hat{k}+\lambda \left( 2\hat{i}-2\hat{j}+5\hat{k} \right)$$.

Where λ is a parameter