The rotation matrix $~\mathbf R_{3\times 3}~$ has 9 direction cosine elements and because $~\mathbf R\,\mathbf R^T\overset{!}{=}\mathbf I_3~$ you obtain 6 constraint equations, this give you 3 generalized coordinates e.g. $~R_{11}(t)~,R_{12}(t)~,R_{23}(t)~$ or equivalent 3 Euler angles $~\alpha,\beta,\gamma~$ where
$$\mathbf R=\mathbf R(\alpha,\beta,\gamma)\quad\text{and $~\mathbf R~$ fulfilled the constraint equations }~ \mathbf R\,\mathbf R^T=\mathbf I_3$$