Content deleted Content added
→Vector rotation: Remove irrelevent mention of ijk |
Ebernardes (talk | contribs) The set of equations using "arctan" is wrong and should be removed to avoid confusion with the correct "atan2" implementation. Example of new paper citing the incorrect equations because of Wikipedia: https://www.sciencedirect.com/science/article/pii/S0926580523003400?via%3Dihub |
||
Line 191:
A direct formula for the conversion from a quaternion to Euler angles in any of the 12 possible sequences exists.<ref>{{cite journal |last1=Bernardes |first1=Evandro |last2=Viollet |first2=Stéphane |title=Quaternion to Euler angles conversion: A direct, general and computationally efficient method |journal=PLOS ONE |date=10 November 2022 |volume=17 |issue=11 |pages=e0276302 |doi=10.1371/journal.pone.0276302 |pmid=36355707 |pmc=9648712 |bibcode=2022PLoSO..1776302B |language=en |issn=1932-6203|doi-access=free }}</ref> For the rest of this section, the formula for the sequence '''Body 3-2-1''' will be shown.
If the quaternion is properly '''normalized''', the Euler angles can be obtained from the quaternions via the relations:
However the [[arctan]] functions implemented in computer languages only produce results between −π/2 and [[right angle|π/2]], to generate all the orientations one needs to replace the arctan functions in computer code by [[atan2]]:▼
:<math>\begin{bmatrix}
Line 212 ⟶ 201:
\end{bmatrix} </math>
▲
Moreover, typical implementations of arctan also might have some numerical disadvantages near zero and one. Some implementations use the equivalent expression:<ref>{{cite journal|last1=Blanco|first1=Jose-Luis|title=A tutorial on se (3) transformation parameterizations and on-manifold optimization|journal=University of Malaga, Tech. Rep|date=2010|citeseerx=10.1.1.468.5407}}</ref>▼
▲
:<math> \theta = \mbox{arcsin} (2(q_w q_y - q_x q_z)) </math>
|