I am writing some CAD software that keeps track of the orientation of the modeled components. The oriention is stored as a single $3\times 3$ orientation matrix that is a product of a reflection $R$ and a rotation $Q$, thus $T = RQ$. The question is, given $T$, can I reconstruct the $R$ and $Q$ components? And if so, is this deconstuction unique?
Notes:
$R$ is a Householder reflection matrix:
$R = I_3 - 2 n n^\text{T}.$ For some unit 3-vector $n$.
$\text{det}(R)$ = -1.
$Q$ is an Euler rotation matrix, $\text{det}(Q)$ = 1.
Rewrite $$RT = Q$$
Now $$Q = {S_1}^{-1}\underset{C_1}{\underbrace{\left(\begin{bmatrix}a&b\\-b&a\end{bmatrix} \otimes 1\right)}}S_1$$ $$R={S_2}^{-1}\underset{C_2}{\underbrace{(1\otimes 1 \otimes -1)}}{S_2}$$
Here $\otimes$ denotes block diagonalization operator. In other words:
$$(a_1\otimes a_2 \otimes ... \otimes a_N) = \begin{bmatrix}a_1&&&\\&a_2&&\\&&\ddots&\\&&&a_N\end{bmatrix}$$
For two arbitrary transformations $S_1,S_2$ and $a=\cos(\phi),b=\sin(\phi)$
We can conclude that if $RT=Q$ holds, then $RT-Q =0$ and furthermore $\|RT-Q\|$ will be minimal.
Now we can create an alternating regularized linear least squares
$$\min\left\{\|RT-Q\|_2 + \|S_2R-C_2S_2\|_2 + \|S_1Q-(C_1)S_1\|_2\right\}$$