We are given the lines \begin{equation*}g: \ \vec{x}=\begin{pmatrix}0 \\ -1 \\1 \end{pmatrix}+s\cdot \begin{pmatrix}1 \\ -1 \\0 \end{pmatrix} \, \ , \, \ h: \ \vec{x}=\begin{pmatrix}9 \\ -8 \\6 \end{pmatrix}+t\cdot \begin{pmatrix}2 \\ -3 \\2 \end{pmatrix}\end{equation*} I want to calcuate the distance.
$$$$
Let $G$, $H$ be points on the lines $g$ and $h$ respectively.
Then these will be of the form \begin{equation*}G=\begin{pmatrix}s \\ -1-s \\1 \end{pmatrix} \ , \ H=\begin{pmatrix}9 +2t\\ -8-3t \\6+2t \end{pmatrix}\end{equation*} So we get \begin{equation*}\vec{GH}=\begin{pmatrix}9 +2t\\ -8-3t \\6+2t \end{pmatrix}-\begin{pmatrix}s \\ -1-s \\1 \end{pmatrix}=\begin{pmatrix}9 +2t-s\\ -7-3t+s \\5+2t \end{pmatrix}\end{equation*}
We choose the points $G$ and $H$ such that $\vec{GH}\cdot \begin{pmatrix}1 \\ -1 \\0 \end{pmatrix}=0$ and $\vec{GH}\cdot \begin{pmatrix}2 \\ -3 \\2 \end{pmatrix}=0$.
We have the following: \begin{equation*}\vec{GH}\cdot \begin{pmatrix}1 \\ -1 \\0 \end{pmatrix}=0\Rightarrow \begin{pmatrix}9 +2t-s\\ -7-3t+s \\5+2t \end{pmatrix}\cdot \begin{pmatrix}1 \\ -1 \\0 \end{pmatrix}=0 \Rightarrow 16 +5t-2s=0\end{equation*}
\begin{equation*}\vec{GH}\cdot \begin{pmatrix}2 \\ -3 \\2 \end{pmatrix}=0\Rightarrow \begin{pmatrix}9 +2t-s\\ -7-3t+s \\5+2t \end{pmatrix}\cdot \begin{pmatrix}2 \\ -3 \\2 \end{pmatrix}=0 \Rightarrow 49+17t-5s=0 \end{equation*}
Solving the system \begin{align*}&16 +5t-2s=0 \\ &49+17t-5s=0\end{align*} we get $t=-2, \ s=3$.
Now we can calculate the vector $\vec{GH}$: \begin{equation*}\vec{GH}=\begin{pmatrix}9 +2\cdot (-2)-3\\ -7-3\cdot (-2)+3 \\5+2\cdot (-2) \end{pmatrix}=\begin{pmatrix}2\\ 2 \\1 \end{pmatrix}\end{equation*} The distance $|\vec{GH}|$ of the lines $g$ and $h$ is therefore equal to \begin{equation*}|\vec{GH}|=\sqrt{2^2+2^2+1^2}=\sqrt{4+4+1}=\sqrt{9}=3\end{equation*}
Is everything correct?
After that I made the graphs and I saw that these lines are intersecting. Shouldn't we get then that the distance is equal to $0$ ?
These two lines do not intersect