I have a question about distance of lines on $\mathbb{R}^3$.
Consider $T$ a line given by $$\alpha(t)=(t+1,3t+1,t-2)$$ and $S$ another line given by $$\beta(s)=(-2s+1,s,2s+3).$$ I computed the distance between those lines and I found that $d(S,R)=\frac{13}{\sqrt{10}}$.
But, how can I find the points $p\in T$ and $q\in S$ that realizes the distance?
I appreciate any help! Thanks.
Say that those two points are $A(t_0+1, 3t_0+1, t_0-2)$ and $B(-2s_0+1, s_0, 2s_0+3)$:
$$\vec{AB}=(-2s_0-t_0, s_0-3t_0-1, 2s_0-t_0+5)$$
This vector is perpendicular to direction vectors of line $\vec\alpha(1,3,1)$ and $\vec\beta(-2,1,2)$, which means that:
$$\vec{AB}\cdot\vec\alpha=(-2s_0-t_0)\cdot1+(s_0-3t_0-1)\cdot3+(2s_0-t_0+5)\cdot1=0\tag{1}$$
$$\vec{AB}\cdot\vec\beta=(-2s_0-t_0)\cdot(-2)+(s_0-3t_0-1)\cdot1+(2s_0-t_0+5)\cdot2=0\tag{2}$$
You have two linear equations (1) and (2). Solve for $t_0,s_0$ and you are done.