Prove that the distance between parallel planes $\vec{n}\cdot \vec{x} = d_1 $, $\vec{n}\cdot \vec{x}=d_2$ is $|d1-d2|/||\vec{n}||$
Let $x_k$, $k=1,2$ be a point in each plane. Write $x_k = \alpha_k n + p_k$, where $p_k \bot n$. Then \begin{eqnarray} \|x_1-x_2\|^2 &=& \| (\alpha_1-\alpha_2)n +(p_1-p_2)\|^2 \\ &=& (\alpha_1-\alpha_2)^2 \|n\|^2+\|p_1-p_2\|^2 \end{eqnarray} Since each $x_k$ lies on each plane, we have $\langle x_k, n\rangle = d_k$, from which we get $\alpha_k = {d_k \over \|n\|^2}$, and so $\|x_1-x_2\| = \sqrt{ ({d_1-d_2 \over \|n\|})^2+ \|p_1-p_2\|^2 }$.
It is easy to see that the distance is minimized if we choose $p_1=p_2$, in which case we get the minimum distance to be ${ |d_1-d_2| \over \|n\|}$
This is a trick that will always work for finding distances between two "flat" objects.
- First, identify the direction in which the "minimum distance" lies.
- Second, take any two random points, one from object 1, the other from object 2.
- Finally, find the length of the projection of your random vector to your direction vector.
I'll put my solution in a spoiler tag so that you can work it out on your own first.
Let $\vec{x}_1$ be a position vector in line $1$, and $\vec{x}_2$ a position vector in line $2$.
Then, the length of the projection is:
$|Proj_{\vec{n}}(\vec{x}_2-\vec{x}_1)| = \dfrac{|(\vec{x}_2 - \vec{x}_1)\cdot\vec{n}|}{||\vec{n}||}$
Now use the fact that
$\vec{x}_1\cdot{\vec{n}} = d_1$ and $\vec{x}_2\cdot{\vec{n}} = d_2$