Closest approach of two uniformly moving particles (source code)

= Closest approach of two uniformly moving particles
{title2=$t_*=-\mathbf d_0\cdot\mathbf v/|\mathbf v|^2$}

If the relative <position> is $\mathbf d(t)=\mathbf d_0+t\mathbf v$ with $\mathbf v\ne0$, completing the square gives
$$
|\mathbf d(t)|^2=|\mathbf v|^2(t-t_*)^2+|\mathbf d_0|^2-\frac{(\mathbf d_0\cdot\mathbf v)^2}{|\mathbf v|^2},\qquad t_*=-\frac{\mathbf d_0\cdot\mathbf v}{|\mathbf v|^2}.
$$
This proves the minimum distance over all real times. If time is restricted to an interval, project $t_*$ onto that interval; if $\mathbf v=0$, the distance is constant. Both particles are evaluated at the same time, unlike the two independent parameters in the <distance between skew lines>.