Suppose you have an ellipsoid with semi-axes lengths $a,b,c$, and you a rectangular box (i.e. cuboid) of dimensions $L, W, H$, with its length $L$ along the $x$ axis, its width $W$ along the $y$ axis, and its height $H$ along the $z$ axis. It can be shown that if the box fits the ellipsoid exactly, i.e. the ellipsoid is tangent to all $6$ sides of the box, then we must have
$$ \dfrac{1}{4} (L^2 + W^2 + H^2) = a^2 + b^2 + c^2 \hspace{20pt}(*) $$
It can also be shown that
$$ e_1^T R D R^T e_1 = \left( \dfrac{L}{2} \right)^2 \hspace{20pt}(1)$$
$$ e_2^T R D R^T e_2 = \left( \dfrac{W}{2} \right)^2 \hspace{20pt} (2)$$
$$ e_3^T R D R^T e_3 = \left( \dfrac{H}{2} \right)^2 \hspace{20pt} (3)$$
where $e_1, e_2, e_3$ are the coordinate unit vectors, and $R$ is the (rotation) matrix that describes the orientation of the semi-axes of the ellipsoid with respect to the world frame, where it is assumed that $L$ is along the $x$ axis, $W$ is along the $y$ axis, and $H$ is along the $z$ axis. Matrix $D$ is a diagonal matrix with the diagonal entries being $a^2, b^2, c^2 $.
Because of the relation $(*)$, only TWO equation of the set $(1), (2), (3)$ are independent, while the third follows from $(*)$.
Since $R$ can be parameterized using $3$ angles, and now we have two constraints on it, then it follows that there is an infinite number of rotation matrices $R$ that satisfy equations $(1), (2), (3) $. And it also follows that $R$ can be parameterized by a single parameter, i.e. we have a single degree of freedom for describing $R$.
My question, is how to find such parameterization of $R$ ?
