Context
I am given the 3 points: $P(3,-1,3)$, $Q(1,-1,6)$, and $R(5,0,1)$
I know that
$\overrightarrow{PQ} =(3-1)\hat{i}+((-1)-(-1))\hat{j}+(3-6)\hat{k} $
$=2\hat{i}+0\hat{j}-3\hat{k}$
and
$\overrightarrow{PR} =(3-5)\hat{i}+((-1)-0)\hat{j}+(3-1)\hat{k} $
$=-2\hat{i}-\hat{j}+2\hat{k}$
and
$\|\overrightarrow{PR}\|=\sqrt{(-2)^2+(-1)^2+2^2} = \sqrt{9} = 3$
Help
I need to find the scalar component of $\overrightarrow{PQ}$ in the direction of $\overrightarrow{PR}$, but I don't understand where to start and how the two parts can be related.
My answer:
In fact $\overrightarrow{PQ}\cdot\overrightarrow{PR}=||\overrightarrow{PQ}||||\overrightarrow{PR}||\cos(\theta)$ where $\theta$ is the angle between the two vectors. $||\overrightarrow{PQ}||\cos(\theta)$ represents the projection of vector $\overrightarrow{PQ}$ onto the direction $\overrightarrow{PR}$, so this is also the scalar component that you want. If $\overrightarrow{PR}$ is a unit vector(means $||\overrightarrow{PR}||=1$), the result is just $\overrightarrow{PQ}\cdot\overrightarrow{PR}$, else the result should be $$\frac{\overrightarrow{PQ}\cdot\overrightarrow{PR}}{||\overrightarrow{PR}||}$$, now you have all the three elements.
This problem is shown is this picture. Clearly, $||\overrightarrow{PQ'}||$ is what you want. $\overrightarrow{PQ}\cdot\overrightarrow{PR}=||\overrightarrow{PQ}||||\overrightarrow{PR}||\cos(\theta)=||\overrightarrow{PQ'}||\cdot||\overrightarrow{PR}||$. Then $||\overrightarrow{PQ'}||=\frac{\overrightarrow{PQ}\cdot\overrightarrow{PR}}{||\overrightarrow{PR}||}$.