We have 2 vectors, s and r. We are looking for s projection (Shade) to r. Aka how much s moves in direction to r.

- If we look at the picture, then s is hypotenuse and its projection to r is $\theta$s adjacent side.
- $cos (\theta) = \frac{adj}{hyp} = \frac{projection}{|s|} => |s| cos(\theta) = \text{projection}$
- From the a) previous point and b) angle derivation based on cosine rule we get $s \cdot r = |r||s|cos(\theta)= |r||projection|$
- Thus $\frac{s\cdot r}{|r|} = |projection| = \text{Projection length of s onto r}$ (Scalar Projection) The length units are in standard basis here. Intuitively, I find with the dot product how much vector s goes in the same direction as vector r, and by dividing I ensure that this "HOW MUCH" would be in standard basis units.
- NB - If |r| is 1, then projecting becomes a simple dot product
- $\frac{r}{|r|}= \text{Vector going within the same direction as r but with length 1}$ (Unit vector in direction of r
- Proof :$\sqrt{\sum{\frac{r_i}{|r|}}^2}=\sqrt{\frac{1}{|r|^2}\sum{r_i}^2}=\sqrt{\frac{1}{\sum{r_i^2}}\sum{r_i}^2}=\sqrt{1}=1$
- Scalar Projection * Unit Vector in direction R = Vector projection = $\frac{s\cdot r}{|r|} \cdot \frac{r}{|r|}$ The vector projection of a vector a onto another vector b is essentially the shadow or component of a that lies in the direction of b.
- Projecting to different basis $\frac{s\cdot r}{|r|{|r|}}$ - explanation below. Opposing to regular projection, the length units are of r basis length here.
Projection is a very relavant topic and comes up for example when we want to do basis changing. Read more Change of Basis
NB — similiar idea in a totally different context Extrinsic & intrinsic rotation: Do I multiply from right or left? | by Dominic Plein | Medium