I think the parametric equation should be (from , if so the point (3,-1,1) (call it ) is on the line. So the is (-5,4,3).
if the vector parallel to the line L is
Now you'll have two vectors that cross each other and one vector starts from point A to point M
take the definition of
if you draw the vector's you'll find is the distance of from the point to the required line