For shortest distance between skew lines, use the formula:
\[d = \frac{|(\vec{b}_1 - \vec{b}_2) \cdot (\vec{d}_1 \times \vec{d}_2)|}{|\vec{d}_1 \times \vec{d}_2|}\]
where a1 and a2 are points on the lines and b1 and b2 are direction vectors of the lines.