Given that $P=(x,x,x)$ and $Q=(y,3y,-1)$ are two lines in $\mathbb{R}^3$ then I need to express in matrix form $\|AX-b\|^2$ to find the distance between $P$ and $Q$. I need to find two points on this line which are closest to each other.
I tried like: $\begin{bmatrix}1&1&1\\ 3&1&0\end{bmatrix}\begin{bmatrix}x\\y\\z\end{bmatrix}=\begin{bmatrix}0\\3\end{bmatrix}$ but after that what I have to do? Thanks for helping