Finding the scalar component of $\overrightarrow{PQ}$ in the direction of $\overrightarrow{PR}$ 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.
 A: 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}||}$.

A: Suppose you have two vectors $\vec{a}$ and $\vec{b}$:
$$\vec{a}=\left(
  \begin{array}{c}
     a_1\\
     a_2\\
     a_3\\
  \end{array}
\right), \quad
\vec{b}=\left(
  \begin{array}{c}
     b_1\\
     b_2\\
     b_3\\
  \end{array}
\right).$$
Then the following holds:
$$\vec{a}\cdot\vec{b} = ||\vec{a}||\ ||\vec{b}||\cos{(\theta)},$$
with $\theta$ the angle between the vectors. On the left-hand side we have the dot product, defined as:
$$\vec{a}\cdot\vec{b} = a_1b_1+a_2b_2+a_3b_3.$$
What you call "the scalar component of $\vec{a}$ in the direction of $\vec{b}$" is equal to $||\vec{a}||\cos{(\theta)}$. You should check this by drawing a sketch and use your knowledge of sines and cosines. I'll denote this value by $\vec{a}\downarrow\vec{b}$. From the first equation we can conclude it is equal to:
$$\vec{a}\downarrow\vec{b}=\frac{\vec{a}\cdot{\vec{b}}}{||\vec{b}||}.$$
In your case we have $\vec{a}=\overrightarrow{PQ}$ and $\vec{b}=\overrightarrow{PR}$, so that the solution is given by:
$$\overrightarrow{PQ}\downarrow\overrightarrow{PR}=\frac{\overrightarrow{PQ}\cdot{\overrightarrow{PR}}}{||\overrightarrow{PR}||}.$$
