Given two vectors $\vec p_1$ and $\vec p_2$ and $\vec v=\vec p_2 - \vec p_1$. Hence, $\vec v=(x_2-x_1, y_2-y_1,z_2-z_1)$. Again, we let $$\hat u=\frac{\vec v}{|v|}=(a,b,c)$$ where, $$a=\frac{x_2-x_1}{|v|}, b=\frac{y_2-y_1}{|v|},c=\frac{z_2-z_1}{|v|}$$, in my book these are said to be the direction cosines of rotation and I can see that a, b and c are cosines of some angle and here $\hat u$ is some unit vector along the axis of rotation.
Now, say we project the vector $\hat u$ to the $yz$ plane as so:
we obtain the vector $\hat u'$ with the angle $Θ$ with the z-axis. If $\hat u_x, \hat u_y, \hat u_z$ are the unit vectors along $x,y,z$ axes respectively, my book gives a relation:
$$\cos(Θ)= \frac{\hat u'.\hat u_z}{|\hat u'|.|\hat u_z|}=\frac{c}{d}$$
where,
$$d=\sqrt{b^2+c^2}$$
and,
$$\hat u_x, \hat u_y, \hat u_z$$ are the standard unit vectors.
I understand how:
$$\cos(Θ)= \frac{\hat u'.\hat u_z}{|\hat u'|.|\hat u_z|}$$
but, I don't understand how:
$$\frac{\hat u'.\hat u_z}{|\hat u'|.|\hat u_z|}=\frac{c}{d}$$
How did this relation get in there?
I'm assuming you had purple=x axis, blue=y axis and red=z axis
Now, as $\hat{u}=(a,b,c)$ you can write $\hat{u'}=(0,b,c)$ and $\hat{u_z}=(0,0,1)$ from the way you have defined them in your question. (Here b and c are the y and z components of $\hat{u}$ )
Now $|\hat{u'}|=(b^2+c^2)^{1/2}$ and $|\hat{u_z}|=1$
So $cos\theta=\frac{\hat{u'}.\hat{u_z}}{|\hat{u'}||\hat{u_z}|}=\frac{c.1}{(b^2+c^2)^{1/2}.1}=\frac{c}{d}$