What is distance between lines x+2y=5 and 2x+4y=7?

Nov 17, 2016

$\frac{3}{2 \sqrt{5}}$

Explanation:

A line can be represented as

$l \to \left\langlep - {p}_{0} , \vec{v}\right\rangle = 0$ which stated that the points along $p - {p}_{0}$ are orthogonal to $\vec{v}$

For the line $a x + b y + c = 0$ we have

${p}_{0}$ is any point obeying the line equation.
$a {x}_{0} + b {y}_{0} + c = 0$
$\vec{v} = \left(a , b\right)$ and
$p = \left(x , y\right)$

so

${l}_{1} \to x + 2 y - 5 = 0$
taking ${p}_{1} = \left(5 , 0\right)$ and ${\vec{v}}_{1} = \left(1 , 2\right)$ we have
${l}_{1} \to \left\langlep - {p}_{1} , {\vec{v}}_{1}\right\rangle = 0$

${l}_{2} \to 2 x + 4 y - 7 = 0$
taking ${p}_{2} = \left(\frac{7}{2} , 0\right)$ and ${\vec{v}}_{2} = \left(2 , 4\right) = 2 {\vec{v}}_{1}$ we have
${l}_{2} \to \left\langlep - {p}_{2} , {\vec{v}}_{2}\right\rangle = \left\langlep - {p}_{2} , 2 {\vec{v}}_{1}\right\rangle = 0$

so ${l}_{1}$ and ${l}_{2}$ are parallel because ${\vec{v}}_{2} = \lambda {\vec{v}}_{1}$ with $\lambda \ne 0$

being parallels, their distance is easily obtained, computing the projection of ${p}_{2} - {p}_{1}$ into the unit vector $\hat{{v}_{1}}$. So

$\hat{{v}_{1}} = \frac{{\vec{v}}_{1}}{\left\lVert {\vec{v}}_{1} \right\rVert} = \left(\left(1 , 2\right)\right) / \sqrt{1 + {2}^{2}} = \left(1 , 2\right) / \sqrt{5}$

${p}_{2} - {p}_{1} = \left(\frac{7}{2} - 5 , 0 - 0\right) = \left(- \frac{3}{2} , 0\right)$ and finally

$d = \left\mid \left\langle{p}_{2} - {p}_{1} , \hat{{v}_{1}}\right\rangle \right\mid = \frac{3}{2 \sqrt{5}}$