User:Think040/sandbox

//

$$\begin{align} \frac{2(q_0q_1 + q_2q_3)}{1-2(q_1^2 + q_2^2)} \end{align}$$

$$\begin{align} q_0 = \cos(\alpha / 2)\cos(\beta / 2)\cos(\gamma / 2) + \sin(\alpha / 2)\sin(\beta / 2)\sin(\gamma / 2)\\ q_1 = \sin(\alpha / 2)\cos(\beta / 2)\cos(\gamma / 2) - \cos(\alpha / 2)\sin(\beta / 2)\sin(\gamma / 2)\\ q_2 = \cos(\alpha / 2)\sin(\beta / 2)\cos(\gamma / 2) + \sin(\alpha / 2)\cos(\beta / 2)\sin(\gamma / 2)\\ q_3 = \cos(\alpha / 2)\cos(\beta / 2)\sin(\gamma / 2) - \sin(\alpha / 2)\sin(\beta / 2)\cos(\gamma / 2) \end{align} $$

$$\begin{align} q_0q_1 = \cos(\alpha / 2)\sin(\alpha / 2) \cos^2(\beta / 2)\cos^2(\gamma /2) - \cos(\alpha / 2)\sin(\alpha / 2) \sin^2(\beta / 2)\sin^2(\gamma /2) + \sin^2(\alpha / 2)\cos(\beta / 2)\sin(\beta / 2)\cos(\gamma / 2)\sin(\gamma / 2) - \cos^2(\alpha / 2)\cos(\beta / 2)\sin(\beta / 2)\cos(\gamma / 2)\sin(\gamma / 2) \\

\end{align}$$

$$\begin{align} q_2q_3 = \cos(\alpha / 2)\sin(\alpha / 2) \cos^2(\beta / 2)\sin^2(\gamma /2) - \cos(\alpha / 2)\sin(\alpha / 2) \sin^2(\beta / 2)\cos^2(\gamma /2) - \sin^2(\alpha / 2)\cos(\beta / 2)\sin(\beta / 2)\cos(\gamma / 2)\sin(\gamma / 2) + \cos^2(\alpha / 2)\cos(\beta / 2)\sin(\beta / 2)\cos(\gamma / 2)\sin(\gamma / 2) \\ \end{align}$$

$$\begin{align} q_0q_1 + q_2q_3 \end{align}$$

$$\begin{align} = \cos(\alpha / 2)\sin(\alpha / 2) (\cos^2(\beta / 2) - \sin^2(\beta / 2)) \end{align}$$

$$\begin{align} = \cos(\alpha / 2)\sin(\alpha / 2)\cos(\beta) \\ \end{align}$$

$$\begin{align} 2(q_0q_1 + q_2q_3) \end{align}$$

$$\begin{align} = 2\cos(\alpha / 2)\sin(\alpha / 2)\cos(\beta) \end{align}$$

$$\begin{align} = \sin(\alpha)\cos(\beta) \end{align}$$

$$\begin{align} q_1^2 = \sin^2(\alpha / 2)\cos^2(\beta / 2)\cos^2(\gamma /2) + \cos^2(\alpha / 2)\sin^2(\beta / 2)\sin^2(\gamma /2) -2 \cos(\alpha / 2)\sin(\alpha / 2)\cos(\beta / 2)\sin(\beta / 2)\cos(\gamma / 2)\sin(\gamma / 2)\\ \end{align}$$

$$\begin{align} q_2^2 = \cos^2(\alpha / 2)\sin^2(\beta / 2)\cos^2(\gamma /2) + \sin^2(\alpha / 2)\cos^2(\beta / 2)\sin^2(\gamma /2) +2 \cos(\alpha / 2)\sin(\alpha / 2)\cos(\beta / 2)\sin(\beta / 2)\cos(\gamma / 2)\sin(\gamma / 2)\\ \end{align}$$

$$\begin{align} q_1^2+q_2^2 \end{align}$$

$$\begin{align} =\sin^2(\alpha / 2)\cos^2(\beta / 2)(\cos^2(\gamma /2) + \sin^2(\gamma /2)) + \cos^2(\alpha / 2)\sin^2(\beta / 2)(\cos^2(\gamma /2) + \sin^2(\gamma /2)) \end{align}$$

$$\begin{align} =\sin^2(\alpha / 2)\cos^2(\beta / 2) + \cos^2(\alpha / 2)\sin^2(\beta / 2) \end{align}$$

$$\begin{align} 1 - 2(q_1^2+q_2^2) \end{align}$$

$$\begin{align} =\sin^2(\alpha / 2) + cos^2(\alpha / 2)-2(q_1^2+q_2^2) \end{align}$$

$$\begin{align} = \sin^2(\alpha / 2) + cos^2(\alpha / 2) -2(\sin^2(\alpha / 2)\cos^2(\beta / 2) + \cos^2(\alpha / 2)\sin^2(\beta / 2)) \end{align}$$

$$\begin{align} = \cos^2(\alpha / 2) + sin^2(\alpha / 2) -2(\cos^2(\alpha / 2)\sin^2(\beta / 2)+ \sin^2(\alpha / 2)\cos^2(\beta / 2)) \end{align}$$

$$\begin{align} =\cos^2(\alpha / 2)(1-2\sin^2(\beta / 2))-sin^2(\alpha / 2)(2\cos^2(\beta / 2)-1) \end{align}$$

$$\begin{align} =\cos^2(\alpha / 2)\cos(\beta)-sin^2(\alpha / 2)\cos(\beta) \end{align}$$

$$\begin{align} =(\cos^2(\alpha / 2)-sin^2(\alpha / 2))\cos(\beta) \end{align}$$

$$\begin{align} =\cos(\alpha)\cos(\beta)

\end{align}$$

$$\begin{align} \frac{2(q_0q_1 + q_2q_3)}{1-2(q_1^2 + q_2^2)} = \frac{\sin(\alpha)\cos(\beta)}{\cos(\alpha)\cos(\beta)} = \frac{\sin(\alpha)}{\cos(\alpha)} =\tan(\alpha) \end{align}$$

$$\begin{align} \alpha =\arctan(\tan(\alpha)) =\arctan(\frac{2(q_0q_1 + q_2q_3)}{1-2(q_1^2 + q_2^2)} ) \end{align}$$

//

$$\begin{align} 2(q_0q_2 - q_1q_3) \end{align}$$

$$\begin{align} q_0 = \cos(\alpha / 2)\cos(\beta / 2)\cos(\gamma / 2) + \sin(\alpha / 2)\sin(\beta / 2)\sin(\gamma / 2)\\ q_1 = \sin(\alpha / 2)\cos(\beta / 2)\cos(\gamma / 2) - \cos(\alpha / 2)\sin(\beta / 2)\sin(\gamma / 2)\\ q_2 = \cos(\alpha / 2)\sin(\beta / 2)\cos(\gamma / 2) + \sin(\alpha / 2)\cos(\beta / 2)\sin(\gamma / 2)\\ q_3 = \cos(\alpha / 2)\cos(\beta / 2)\sin(\gamma / 2) - \sin(\alpha / 2)\sin(\beta / 2)\cos(\gamma / 2) \end{align} $$

$$\begin{align} q_0q_2 = + \cos^2(\alpha / 2)\cos(\beta / 2)\sin(\beta / 2) \cos^2(\gamma /2) + \sin^2(\alpha / 2) \cos(\beta / 2)\sin(\beta / 2)\sin^2(\gamma /2) + \cos(\alpha / 2)\sin(\alpha / 2)\cos^2(\beta / 2)\cos(\gamma / 2)\sin(\gamma / 2) + \cos(\alpha / 2)\sin(\alpha / 2)\sin^2(\beta / 2)\cos(\gamma / 2)\sin(\gamma / 2) \end{align}$$

$$\begin{align} q_1q_3 = -\cos^2(\alpha / 2)\cos(\beta / 2)\sin(\beta / 2) \sin^2(\gamma /2) - \sin^2(\alpha / 2) \cos(\beta / 2)\sin(\beta / 2)\cos^2(\gamma /2) + \cos(\alpha / 2)\sin(\alpha / 2)\cos^2(\beta / 2)\cos(\gamma / 2)\sin(\gamma / 2) + \cos(\alpha / 2)\sin(\alpha / 2)\sin^2(\beta / 2)\cos(\gamma / 2)\sin(\gamma / 2) \end{align}$$

$$\begin{align} q_0q_2 - q_1q_3 \end{align}$$

$$\begin{align} = (\cos^2(\alpha / 2) + \sin^2(\alpha / 2)) \cos(\beta / 2)\sin(\beta / 2) \end{align}$$

$$\begin{align} = \cos(\beta / 2)\sin(\beta / 2) \end{align}$$

$$\begin{align} 2(q_0q_2 - q_1q_3) \end{align}$$

$$\begin{align} = 2\cos(\beta / 2)\sin(\beta / 2) \end{align}$$

$$\begin{align} = \sin(\beta) \end{align}$$

$$\begin{align} 2(q_0q_2 - q_1q_3) =\sin(\beta) \end{align}$$

$$\begin{align}

\beta =\arcsin(\sin(\beta)) =\arcsin(2(q_0q_2 - q_1q_3)) \end{align}$$

//

$$\begin{align} \frac{2(q_0q_3 + q_1q_2)}{1-2(q_2^2 + q_3^2)} \end{align}$$

$$\begin{align} q_0 = \cos(\alpha / 2)\cos(\beta / 2)\cos(\gamma / 2) + \sin(\alpha / 2)\sin(\beta / 2)\sin(\gamma / 2)\\ q_1 = \sin(\alpha / 2)\cos(\beta / 2)\cos(\gamma / 2) - \cos(\alpha / 2)\sin(\beta / 2)\sin(\gamma / 2)\\ q_2 = \cos(\alpha / 2)\sin(\beta / 2)\cos(\gamma / 2) + \sin(\alpha / 2)\cos(\beta / 2)\sin(\gamma / 2)\\ q_3 = \cos(\alpha / 2)\cos(\beta / 2)\sin(\gamma / 2) - \sin(\alpha / 2)\sin(\beta / 2)\cos(\gamma / 2) \end{align} $$

$$\begin{align} q_0q_3 = +\cos^2(\alpha / 2)\cos^2(\beta / 2)\cos(\gamma /2)\sin(\gamma / 2) - \sin^2(\alpha / 2)\sin^2(\beta / 2)\cos(\gamma / 2)\sin(\gamma / 2) +\cos(\alpha / 2)\sin(\alpha / 2)\cos(\beta / 2)\sin(\beta / 2)\sin^2(\gamma / 2) -\cos(\alpha / 2)\sin(\alpha / 2)\cos(\beta / 2)\sin(\beta / 2)\cos^2(\gamma / 2) \end{align}$$

$$\begin{align} q_1q_2 = +\sin^2(\alpha / 2)\cos^2(\beta / 2)\cos(\gamma / 2)\sin(\gamma / 2) -\cos^2(\alpha / 2)\sin^2(\beta / 2)\cos(\gamma /2)\sin(\gamma / 2) -\cos(\alpha / 2)\sin(\alpha / 2)\cos(\beta / 2)\sin(\beta / 2)\sin^2(\gamma / 2) +\cos(\alpha / 2)\sin(\alpha / 2)\cos(\beta / 2)\sin(\beta / 2)\cos^2(\gamma / 2) \end{align}$$

$$\begin{align} q_0q_3 + q_1q_2 \end{align}$$

$$\begin{align} = (\cos^2(\beta / 2) - \sin^2(\beta / 2))\cos(\gamma / 2)\sin(\gamma / 2) \end{align}$$

$$\begin{align} = \cos(\beta)\cos(\gamma / 2)\sin(\gamma / 2) \end{align}$$

$$\begin{align} 2(q_0q_3 + q_1q_2) \end{align}$$

$$\begin{align} = \cos(\beta)2\cos(\gamma / 2)\sin(\gamma / 2) \end{align}$$

$$\begin{align} = \cos(\beta)\sin(\gamma) \end{align}$$

$$\begin{align} q_2^2 = \cos^2(\alpha / 2)\sin^2(\beta / 2)\cos^2(\gamma /2) + \sin^2(\alpha / 2)\cos^2(\beta / 2)\sin^2(\gamma /2) +2 \cos(\alpha / 2)\sin(\alpha / 2)\cos(\beta / 2)\sin(\beta / 2)\cos(\gamma / 2)\sin(\gamma / 2) \end{align}$$

$$\begin{align} q_3^2 = \sin^2(\alpha / 2)\sin^2(\beta / 2)\cos^2(\gamma /2) +\cos^2(\alpha / 2)\cos^2(\beta / 2)\sin^2(\gamma /2) -2 \cos(\alpha / 2)\sin(\alpha / 2)\cos(\beta / 2)\sin(\beta / 2)\cos(\gamma / 2)\sin(\gamma / 2) \end{align}$$

$$\begin{align} q_2^2+q_3^2 \end{align}$$

$$\begin{align} = (\cos^2(\alpha /2) + \sin^2(\alpha /2))\sin^2(\beta / 2)\cos^2(\gamma / 2) + (\cos^2(\alpha /2) + \sin^2(\alpha /2))\cos^2(\beta / 2)\sin^2(\gamma / 2) \end{align}$$

$$\begin{align} = \sin^2(\beta / 2)\cos^2(\gamma / 2) + cos^2(\beta / 2)\sin^2(\gamma / 2) \end{align}$$

$$\begin{align} 1 - 2(q_2^2+q_3^2) \end{align}$$

$$\begin{align} =\sin^2(\gamma / 2) + cos^2(\gamma / 2)-2(q_2^2+q_3^2) \end{align}$$

$$\begin{align} = \sin^2(\gamma / 2) + cos^2(\gamma / 2) -2(\sin^2(\beta / 2)\cos^2(\gamma / 2) + \cos^2(\beta / 2)\sin^2(\gamma / 2)) \end{align}$$

$$\begin{align} = cos^2(\gamma / 2) + \sin^2(\gamma / 2) -2(\sin^2(\beta / 2)\cos^2(\gamma / 2) +\cos^2(\beta / 2)\sin^2(\gamma / 2)) \end{align}$$

$$\begin{align} = (1-2\sin^2(\beta / 2))\cos^2(\gamma / 2) -(2\cos^2(\beta / 2)-1)\sin^2(\gamma / 2)) \end{align}$$

$$\begin{align} = \cos(\beta)\cos^2(\gamma / 2) -\cos(\beta)\sin^2(\gamma / 2)) \end{align}$$

$$\begin{align} = \cos(\beta)(\cos^2(\gamma / 2) -\sin^2(\gamma / 2)) \end{align}$$

$$\begin{align} = \cos(\beta)\cos(\gamma) \end{align}$$

$$\begin{align} \frac{2(q_0q_3 + q_1q_2)}{1-2(q_2^2 + q_3^2)} = \frac{\cos(\beta)\sin(\gamma)}{\cos(\beta)\cos(\gamma)} = \frac{\sin(\gamma)}{\cos(\gamma)} =\tan(\gamma) \end{align}$$

$$\begin{align} \gamma =\arctan(\tan(\gamma)) =\arctan(\frac{2(q_0q_3 + q_1q_2)}{1-2(q_2^2 + q_3^2)}) \end{align}$$