Given two lines:
$$r_1(t) = (a_1, b_1, c_1) + t(p_1, q_1, r_1)$$
$$r_2(s) = (a_2, b_2, c_2) + s(p_2, q_2, r_2)$$
I have calculated the cross product of the direction vectors to get the vector perpendicular to both lines:
$$\vec n = (p_1, q_1, r_1) \times (p_2, q_2, r_2)$$
Which gives the vector $\vec n$.
I then got a vector $\vec V$ between a point on each line, and calculated the minimum distance $d$ between both lines by finding the scalar projection of $\vec V$ onto $\vec n$.
$$d = \frac{|\vec V \cdot \vec n|}{|\vec n|}$$
I now need the points on both lines where this minimum distance is achieved, how would I go about doing that?
Thanks for any help.