Although there is a formula, use the following(you can derive the formula using it)Originally Posted by kingkaisai2
One thing I want to say is that the distance between a line and a point is the length of the perpendicular drawn from the the point to the line.
Let P(x,y,z) be a point lying on the line.(Let your point be A)
For distance AP to be minimum, line segmentAP should be perpendicular to the line.(Using this contion you could find the x,y,z).
After finding P, you could find distance AP using Distance formula.