Assume $\{\alpha_1,\cdots\alpha_n\},\{\epsilon_1,\cdots,\epsilon_n\} $ are both orthonormal basis of Euclidean Space $V$. Consider the matrix $$A=(\cos\langle\alpha_i,\epsilon_j\rangle)_{n\times n}$$ $\langle\alpha_i,\epsilon_j\rangle$ denotes the angle between $\alpha_i,\epsilon_j$.
Prove 1. A is orthogonal. 2. Every orthogonal matrix can express as the form of $A$.
i.e prove $$\cos\langle\alpha_i,\epsilon_1\rangle\cdot \cos\langle\alpha_j,\epsilon_1\rangle+\cos\langle\alpha_i,\epsilon_2\rangle\cdot\cos\langle\alpha_j,\epsilon_2\rangle+\\ \cdots+\cos\langle\alpha_i,\epsilon_n\rangle\cdot\cos\langle\alpha_j,\epsilon_n\rangle=0$$ for $i\ne j$.
And
$$\cos\langle\alpha_i,\epsilon_1\rangle\cdot \cos\langle\alpha_j,\epsilon_1\rangle+\cos\langle\alpha_i,\epsilon_2\rangle\cdot\cos\langle\alpha_j,\epsilon_2\rangle+\\ \cdots+\cos\langle\alpha_i,\epsilon_n\rangle\cdot\cos\langle\alpha_j,\epsilon_n\rangle=1$$ for $i=j$.
How to deal with the sum?
Hint. The cosine of the angle between two unit vectors $u$ and $v$ is just their dot product, i.e. $u^Tv$. So, if $P$ is the augmented matrix containing the $\alpha_j$s as columns and $Q$ is the augmented matrix containing the $\varepsilon_j$s as columns, then $A=P^TQ$.
For the second part, take $Q=A$ with an appropriate $P$.