[Math] Find the closest point on one line to another line in 3D

calculus

Let P = (1, 1, -1), Q = (2, -2, -3), and R = (-1, 0, 4) be the vertices of a triangle.

Let L be a line passing through P and Q.

Find:

The point on the line x = y + 1 = z – 2 closest to the line L.

Best Answer

Hint: A parameterized version of L is $(1+t,1-3t,-1-2t)$. The other line is $(s, 1+s, s-2)$. So you can just calculate the squared distance, take the derivative with respect to s and t, and get two equations in two unknowns.