Distance between line and a point Consider the points (1,2,-1) and (2,0,3).
(a) Find a vector equation of the line through these points in parametric form.
(b) Find the distance between this line and the point (1,0,1). (Hint: Use the parametric form of the equation and the dot product)
I have solved (a), Forming:
Vector equation: (1,2,-1)+t(1,-2,4)
x=1+t
y=2-2t
z=-1+4t
However, I'm a little stumped on how to solve (b).

A line through the points $p_1$ and $p_2$ can be written as
$$
\bbox[5px,border:2px solid #00A000]{p=p_1+(p_2-p_1)t}\tag{1}
$$
The distance from the line in $(1)$ is given by
$$
\bbox[5px,border:2px solid #C0A000]{\left|\,(p-p_1)-\frac{(p-p_1)\cdot(p_2-p_1)}{|p_2-p_1|^2}(p_2-p_1)\,\right|}\tag{2}
$$

Plugging in the values for the points $p_1=(1,2,-1)$, $p_2=(2,0,3)$, and $p=(1,0,1)$ into $(1)$ and $(2)$, we get that the line sought is
$$
\bbox[5px,border:2px solid #00A000]{(1,2,-1)+(1,-2,4)t}\tag{3}
$$
and the distance sought is
$$
\begin{align}
\left|\,(0,-2,2)-\frac{(0,-2,2)\cdot(1,-2,4)}{|(1,-2,4)|^2}(1,-2,4)\,\right|
&=\left|\,(0,-2,2)-\frac{12}{21}(1,-2,4)\,\right|\\[6pt]
&=\left|\,\frac17(-4,-6,-2)\,\right|\\
&=\bbox[5px,border:2px solid #C0A000]{\frac{2\sqrt{14}}7}\tag{4}
\end{align}
$$

Justification of $\boldsymbol{(2)}$
Note that
$$
(p-p_1)-\frac{(p-p_1)\cdot(p_2-p_1)}{|p_2-p_1|^2}(p_2-p_1)\tag{5}
$$
and
$$
\frac{(p-p_1)\cdot(p_2-p_1)}{|p_2-p_1|^2}(p_2-p_1)\tag{6}
$$
are perpendicular (their dot product is $0$) and sum to $p-p_1$. Thus, they form the triangle

