# Finding the minimal distance between two lines? [duplicate]

So I have a line that looks like this $\begin{pmatrix}1\\2\\-1\end{pmatrix}$ + t$\begin{pmatrix}1\\5\\1\end{pmatrix}$. And I'm trying to find the minimal distance between that line and the line x1 = x2 = x3. I know the find the distance between two lists would be to subtract the lists and the find the length of that but how would I find the distance for two equations like this?

• I imagine the shortest path between them should lie on a line that is perpendicular to both. Now what? Oops, also there is math.stackexchange.com/questions/210848 Sep 28 '16 at 16:36

The lines are $$\pmatrix{0\\0\\0}+s\pmatrix{1\\1\\1}$$
and $$\pmatrix{1\\2\\-1}+t\pmatrix{1\\5\\1}$$
The plane $$s\pmatrix{1\\1\\1}+t\pmatrix{1\\5\\1}$$
So, you only have to calculate the distance of the point $P(1/2/-1)$ from the first line. Take it from here.
• Another hint : A normal vector for the plane is $\pmatrix{-1\\0\\1}$ Sep 28 '16 at 16:43