The connection is made by comparing the DCM elements with the combined Euler 323 sequence. The DCM matrix is D C M = [ A 11 A 12 A 13 A 21 A 22 A 23 A 31 A 32 A 33 ] {\displaystyle DCM=\left[{\begin{matrix}A_{11}&A_{12}&A_{13}\\A_{21}&A_{22}&A_{23}\\A_{31}&A_{32}&A_{33}\end{matrix}}\right]} The Euler 323 sequence is R 3 ( ψ ) R 2 ( θ ) R 3 ( φ ) = [ c ψ c θ c φ − s ψ s φ c ψ c θ s φ + s ψ c φ − c ψ s θ − s ψ c θ c φ − c ψ s φ − s ψ c θ s φ + c ψ c φ s ψ s θ s θ c φ s θ s φ c θ ] {\displaystyle R_{3}(\psi )R_{2}(\theta )R_{3}(\phi )=\left[{\begin{matrix}c_{\psi }c_{\theta }c_{\phi }-s_{\psi }s_{\phi }&c_{\psi }c_{\theta }s_{\phi }+s_{\psi }c_{\phi }&-c_{\psi }s_{\theta }\\-s_{\psi }c_{\theta }c_{\phi }-c_{\psi }s_{\phi }&-s_{\psi }c_{\theta }s_{\phi }+c_{\psi }c_{\phi }&s_{\psi }s_{\theta }\\s_{\theta }c_{\phi }&s_{\theta }s_{\phi }&c_{\theta }\end{matrix}}\right]} If we examine the element in coloum 3 row 3, then by inspection A 33 = c o s ( θ ) {\displaystyle A_{33}=cos(\theta )} Solving for θ {\displaystyle \theta } yields θ = c o s − 1 ( A 33 ) {\displaystyle \theta =cos^{-1}(A_{33})} Care must now be taken when evaluating the inverse cosine. It is a multivalued function. Analytically, the convention is to choose the principle value such that 0 ≤ θ ≤ π {\displaystyle 0\leq \theta \leq \pi } If a numerical program is used, a function acos() usually does this for us. The next step is to analyze the ratio A 32 A 31 {\displaystyle {\frac {A_{32}}{A_{31}}}} . Using these values from the Euler sequence we get A 32 A 31 = s i n ( θ ) s i n ( φ ) s i n ( θ ) c o s ( φ ) {\displaystyle {\frac {A_{32}}{A_{31}}}={\frac {sin(\theta )sin(\phi )}{sin(\theta )cos(\phi )}}} Rearranging and using the tangent yields t a n ( φ ) = A 32 A 31 {\displaystyle tan(\phi )={\frac {A_{32}}{A_{31}}}} Solving the quadrant ambiquity caused by the inverse tangent is done by examining the signs of the numerator and denominator. Denoting y as the numerator and x as the denominator, then the quadrant is chosen by: quadrant 1  \left[ \begin{matrix} y & x \\ + & + \\ \end{matrix} \right] s o i f x a n d y a r e b o t h p o s i t i v e , t h e n < m a t h > 0 ≤ φ ≤ π / 2 {\displaystyle soifxandyarebothpositive,then0\leq \phi \leq \pi /2} . Similarily for the other quadrant possibilites quadrant 2  \left[ \begin{matrix} y & x \\ + & - \\ \end{matrix} \right] q u a d r a n t 3 {\displaystyle quadrant3} \left[ \begin{matrix} y & x \\ - & - \\ \end{matrix} \right] q u a d r a n t 4 {\displaystyle quadrant4} \left[ \begin{matrix} y & x \\ - & + \\ \end{matrix} \right] O f c o u r s e , i t i s m u c h s i m p l i e r t o u s e a c a l c u l a t o r o r n u m e r i c a l p r o g r a m t h a t u s e s t h e a t a n 2 ( ) f u n c t i o n w h i c h w i l l c h o o s e t h e p r i n c i p l e v a l u e . I n a s i m i l a r f a s h i o n w e c a n f i n d t h e f i n a l E u l e r a n g l e b y l o o k i n g a t t h e r a t i o < m a t h > A 23 A 13 {\displaystyle Ofcourse,itismuchsimpliertouseacalculatorornumericalprogramthatusestheatan2()functionwhichwillchoosetheprinciplevalue.InasimilarfashionwecanfindthefinalEuleranglebylookingattheratio{\frac {A_{23}}{A_{13}}}} which gives the relation A 23 A 13 = s i n ( ψ ) s i n ( θ ) − c o s ( ψ ) s i n ( θ ) {\displaystyle {\frac {A_{23}}{A_{13}}}={\frac {sin(\psi )sin(\theta )}{-cos(\psi )sin(\theta )}}} Canceling terms and rearrangeing gives us ψ = t a n − 1 ( A 23 − A 13 ) {\displaystyle \psi =tan^{-1}({\frac {A_{23}}{-A_{13}}})} which uses the same method to resolove quadrant ambiguity as above. To summarize, we will give the formulas for the conversion from a direction cosine matrix to the Euler 232 angles in Matlab syntax. φ = a t a n 2 ( A 32 , A 31 ) {\displaystyle \phi =atan2(A_{32},A_{31})} θ = a c o s ( A 33 ) {\displaystyle \theta =acos(A_{33})} ψ = a t a n 2 ( A 23 , − A 13 ) {\displaystyle \psi =atan2(A_{23},-A_{13})}
{'wiki_source': 'wikiversity', 'other_info': "{'content_model': 'wikitext', 'language': 'en', 'title': 'PlanetPhysics/Direction Cosine Matrix to Euler 323 Angles', 'type': 'text'}"}