$$g_1: \vec x = \vec b_1 +s \vec r_1, s, \in \mathbb{R}$$ $$g_2: \vec x = \vec b_2 +t \vec r_2, t, \in \mathbb{R}$$
Given this information calculate the values of $s$ and $t$. Using that find the coordinates where the distance is the shortest and then calculate the actual shortest distance between $g_1$ and $g_2$.
Here is my attempt.
$$F_{g_1}=(1+2s \ | \ 6 \ | \ 1+s)$$ $$F_{g_2}=(6+9t \ | \ 8+6t \ | \ 9+9t)$$
$$\vec {F_{g_1}F_{g_2}}= \vec f_{g_2}-\vec f_{g_1}= \begin{bmatrix}5+9t-2s\\2+6t\\8+9t-s\end{bmatrix}$$
- $$\vec {F_{g_1}F_{g_2}} \cdot \vec r_1= \vec 0 \implies 27t-5s= -18$$
- $$\vec {F_{g_1}F_{g_2}} \cdot \vec r_2= \vec 0 \implies 198t-27s= -129$$
Using Gaussian Elimination I get that $t= \frac {-53}{87}$ and $\frac {9}{29}$, which I then put back into the equation and I get the coordinates:
$$F_{g_1}=(\frac{47}{29} \ | \ 6 \ | \ \frac{38}{29})$$ $$F_{g_2}=(\frac{15}{29} \ | \ \frac{126}{29} \ | \ \frac{102}{29})$$
$$\vec {F_{g_1}F_{g_2}}= \vec f_{g_2}-\vec f_{g_1}=\begin{bmatrix}\frac{-32}{29}\\\frac{-48}{29}\\\frac{64}{29}\end{bmatrix}$$
Therefore $d(g_1,g_2) = |\vec {F_{g_1}F_{g_2}}|= \frac{16\sqrt{29}}{29} \approx 3.0$
Im confused about two things. Firstly, if this is correct and if it is correct then how do we know that this is actually the shortest distance between the two line?