Let X=(2,1,3) Pick two random point on the line say t=0 and t=1 (can be anything really) So let A=(1,-1,2) and B=(3,-1,-1) Then \overrightarrow{AB}=(2,0,-3) and \overrightarrow{AX}=(1,2,1)
The vector projection of v onto u is defined as
proj_{u}v=\frac{u\cdot v}{|u|^2}u
In our case the u is...