This is easiest with vectors, as discussed here:
http://math.stackexchange.com/questions/371649/distance-of-a-3d-point-from-the-parametric-form-of-a-line
Using the distance formula and calculus is a bit more involved.
Let L be the line with parametric equations
x = 1−2t
y = 3+3t
z = −1−3t
Find the shortest distance d from the point P0=(1, −4, −2) to L, and the point Q on L that is closest to P0. Use the square root symbol '√' where needed to give an exact
value for your answer.
Find
d=?
Q=(_,_,_)
2 answers
or
http://geomalgorithms.com/a02-_lines.html
http://geomalgorithms.com/a02-_lines.html