One of my textbooks reports that to find the length of a projection of $v$ on $w$ I need to use the following formula:
$$\frac{\langle v, w\rangle}{||w||}$$
My professor told us the formula to find the vector of the projection is
$$p_w(v)= \frac{\langle v, w\rangle}{\langle w, w\rangle}\cdot w$$
Now, in the first we should be getting a number, in the second we should be getting a vector. I don't understand how someone could rework these formulas to get one from the other. Any hints?
The first formula is the signed length (i.e. the length, if the projection is pointing in the same direction as $w$, or the length, multiplied by $-1$, if the direction is reversed) of the vector in the second formula, since (using the simple fact that $\langle w,w\rangle = \|w\|^2$)
$$\frac{\langle v,w\rangle}{\langle w,w\rangle}\cdot w = \frac{\langle v,w\rangle}{\|w\|^2}\cdot w = \frac{\langle v,w\rangle}{\|w\|}\cdot \frac{w}{\|w\|}$$
and, of course, the length of the vector $\frac{w}{\|w\|}$ is $1$.