$\cos^2 \alpha + \cos^2 \beta + \cos^2 \gamma =1$ Let be $\alpha, \beta, \gamma$  the angles between a generic direction in 3D and the axes $x,y,z$, respectively.
Prove that
$\cos^2 \alpha + \cos^2 \beta + \cos^2 \gamma =1$.

PS: the 2D case is trivial. But I can't prove the 3D case.
Consider the unit vector $$(u,v,w).$$

The cosines of the angles it forms with the axis are given by the dot products

$$\cos\alpha=(1,0,0)\cdot(u,v,w)=u,\\\cos\beta=(0,1,0)\cdot(u,v,w)=v,\\\cos\gamma=(0,0,1)\cdot(u,v,w)=w,$$

and as it is unit

$$u^2+v^2+w^2=1.$$
Hint: If $u$ and $v$ are vectors making an angle $\theta$ then $$u\cdot v=||u||\,||v||\cos(\theta).$$