Conversion between quaternions and Euler angles: Difference between revisions

Content deleted Content added
Vector rotation: Use consistent notation for the vector rotation section "Q = (Q_w,vec(Q))" hope I got it right
Vector rotation: Remove irrelevent mention of ijk
Line 261:
== Vector rotation ==
 
Let us define scalar <math>q_w</math> and vector <math>\vec{q}</math> such that quaternion <math>\mathbf{q} = (q_w,\vec{q}) = q_w+iq_x+jq_y+kq_z</math>.
 
Note that the canonical way to rotate a three-dimensional vector <math>\vec{v}</math> by a quaternion <math>q</math> defining an [[#Conversion|Euler rotation]] is via the formula
:<math>\mathbf{v}^{\,\prime} = \mathbf{qvq}^\ast</math>
where <math>\mathbf{v} = (0,\vec{v}) = 0+iv_x+jv_y+kv_z</math> is a quaternion containing the embedded vector <math>\vec{v}</math>, <math>\mathbf{q}^\ast=(q_w,-\vec{q})</math> is a [[Quaternion#Conjugation, the norm, and reciprocal|conjugate quaternion]], and <math>\mathbf{v}^{\,\prime} = (0,\vec{v}^{\,\prime})</math> is the rotated vector <math>\vec{v}^{\,\prime}</math>. In computational implementations this requires two quaternion multiplications. An alternative approach is to apply the pair of relations
:<math>\vec{t} = 2\vec{q} \times \vec{v}</math>
:<math>\vec{v}^{\,\prime} = \vec{v} + q_w \vec{t} + \vec{q} \times \vec{t}</math>