New Immissions/Updates:
boundless - educate - edutalab - empatico - es-ebooks - es16 - fr16 - fsfiles - hesperian - solidaria - wikipediaforschools
- wikipediaforschoolses - wikipediaforschoolsfr - wikipediaforschoolspt - worldmap -

See also: Liber Liber - Libro Parlato - Liber Musica  - Manuzio -  Liber Liber ISO Files - Alphabetical Order - Multivolume ZIP Complete Archive - PDF Files - OGG Music Files -

PROJECT GUTENBERG HTML: Volume I - Volume II - Volume III - Volume IV - Volume V - Volume VI - Volume VII - Volume VIII - Volume IX

Ascolta ""Volevo solo fare un audiolibro"" su Spreaker.
CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
Quaternions and spatial rotation - Wikipedia, the free encyclopedia

Quaternions and spatial rotation

From Wikipedia, the free encyclopedia

Quaternions provide a convenient mathematical notation for representing orientations and rotations of objects. Due to certain compactness, efficiency, and stability advantages over matrices, quaternions have found their way into applications in computer graphics, robotics, global navigation, and orbital mechanics of satellites.[1]

Contents

[edit] Quaternion rotation operations

[edit] Goal

The goal is to find a formula that expresses rotation in 3D space using quaternion multiplication. Ideally, this formula should be an analog to the complex multiplication used to represent 2D rotations:

f(w) = zw \,,

where

z = e^{\alpha i} \,

is used for rotation by an angle α.

[edit] Derivation

The desired 3D rotation formula cannot be simple quaternion multiplication, because rotating a vector should yield a vector. Multiplying a vector with a non-trivial quaternion yields a result with non-zero real part, which is not a vector.

However, it turns out that we can cancel the real part if we multiply by a quaternion from one side and by the inverse of that quaternion from the other side. Let z = a + u be a non-zero quaternion, and consider the function

f(\mathbf{v} ) = z \, \mathbf{v} \, z^{-1}\,

where z−1 is the multiplicative inverse of z and v is a vector, considered as a quaternion with zero real part. The function f is known as conjugation by z. Note that the real part of f(v) is zero, because in general zw and wz have the same real part for any quaternions z and w, and so

\mathfrak{R}(z \ \mathbf{v} \ z^{-1}) = \mathfrak{R}(\mathbf{v} \ z^{-1} \ z) = \mathfrak{R}(\mathbf{v} \ 1) = 0

(note that this proof requires the associativity of quaternion multiplication). Furthermore, f is R-linear and we have f(v) = v if and only if v and the imaginary part u of z are collinear (because f(v) = v means v z = z v). Hence f is a rotation whose axis of rotation passes through the origin and is given by the vector u.

Note that conjugation with z is the equivalent to conjugation with rz for any real number r. We can thus restrict our attention to the quaternions of absolute value 1, the so-called unit quaternions. Note that even then z and −z represent the same rotation. (The absolute value |z| of the quaternion z = a + v is defined as the square root of a2 + ||v||2, which makes it multiplicative: |zw| = |z| |w|.) Inverting unit quaternions is especially easy: If |z| = 1, then z−1 = z* (the conjugate z* of the quaternion z = a + v is defined as z* = av) and this makes our rotation formula even easier.

It turns out that the angle of rotation α is also easy to read off if we are dealing with a unit quaternion z = a + v: we have

a = \cos \frac{\alpha}{2}.

[edit] Summary

To summarize, a counterclockwise rotation through an angle α about an axis v can be represented via conjugation by the unit quaternion z

z = \cos\frac{\alpha}{2} + \sin\frac{\alpha}{2}\,\hat\mathbf{v}

where \hat\mathbf{v} is the normalized vector

\hat\mathbf{v} = \frac{\mathbf{v}}{\|\mathbf{v}\|}.

The composition of two rotations corresponds to quaternion multiplication: if the rotation f is represented by conjugation with the quaternion z and the rotation g is represented by conjugation with w, then the composition f ∘ g is represented by conjugation with zw.

If one wishes to rotate about an axis that doesn’t pass through the origin, then one first translates the vectors into the origin, conjugates, and translates back.

The angle between two quaternions should not be confused with the angle of rotation involved in the rotation between the orientations corresponding to these quaternions: the former is half of the latter (or 180° minus half the latter). The angle between the axes of two rotations is again different.

For example the quaternion for the identity is ±1 and for a 180° rotation about the z-axis is ±k. The angle between the two quaternions is 90°. The angle between the axes of the two rotations is in this case undefined.

[edit] Example

Consider the rotation f around the axis u = i + j + k, with a rotation angle of 120°, or 3 radians.

\alpha = \frac{2 \pi}{3} = 120^\circ

The length of u is √3, the half angle is π3 (60°) with cosine ½ (cos 60° = 0.5) and sine √32 (sin 60° = 0.866). We are therefore dealing with a conjugation by the unit quaternion

z = \cos\frac{\alpha}{2} + \sin\frac{\alpha}{2}\,\hat\mathbf{u}
z = \cos 60^\circ + \sin 60^\circ\,\hat\mathbf{u}
z = \frac{1}{2} + \frac{\sqrt{3}}{2}\cdot\,\hat\mathbf{u}
z = \frac{1}{2} + \frac{\sqrt{3}}{2}\cdot \frac{(i+j+k)}{\sqrt{3}}
z = \frac{1 + i + j + k}{2}.

Concretely,

f(ai + bj + ck) = z (ai + bj + ck) z .

Note that z = 1/z, as z has unit modulus; here z = (1−ijk)/2. This can be simplified, using the ordinary rules for quaternion arithmetic, to

f(ai + bj + ck) = ci + aj + bk,

as expected: the rotation corresponds to keeping a cube held fixed at one point, and rotating it 120° about the long diagonal through the fixed point (observe how the three axes are permuted cyclically).

[edit] Quaternion non-commutativity and rotations

The multiplication of quaternions is non-commutative. Since this operation corresponds to a three dimensional rotation, this property can be easily demonstrated by showing that three dimensional rotations are not commutative in general. A simple exercise of applying two rotations to an asymmetrical object (eg. a book) can explain it. First, rotate a book 90 degrees clockwise around the z axis. Next rotate it 180 degrees clockwise around the x axis. Then restore the original orientation, so that the book title is again readable, and apply those rotations in opposite order. This shows that, in general, the composition of two different rotations around two distinct spatial axes will not commute.

[edit] Quaternions versus other representations of rotations

The representation of a rotation as a quaternion (4 numbers) is more compact than the representation as an orthogonal matrix (9 numbers). Furthermore, for a given axis and angle, one can easily construct the corresponding quaternion, and conversely, for a given quaternion one can easily read off the axis and the angle. Both of these are much harder with matrices or Euler angles.

In computer games and other applications, one is often interested in “smooth rotations,” meaning that the scene should slowly rotate and not in a single step. This can be accomplished by choosing a curve such as the spherical linear interpolation in the quaternions, with one endpoint being the identity transformation 1 (or some other initial rotation) and the other being the intended final rotation. This is more problematic with other representations of rotations.

When composing several rotations on a computer, rounding errors necessarily accumulate. A quaternion that’s slightly off still represents a rotation after being normalised—a matrix that’s slightly off need not be orthogonal anymore and therefore is harder to convert back to a proper orthogonal matrix.

Quaternions also avoid a phenomena called gimbal lock which can result when, for example in pitch/yaw/roll rotational systems, the pitch is rotated 90 degrees up or down, so that yaw and roll then correspond to the same motion, and a degree of freedom of rotation is lost. In the case of airplane controls, this could have disastrous results if an airplane is in a steep dive or ascent.

The orthogonal matrix corresponding to a rotation by the unit quaternion z = a + bi + cj + dk (with |z| = 1) is given by

\begin{pmatrix} a^2+b^2-c^2-d^2&2bc-2ad        &2ac+2bd        \\ 2ad+2bc        &a^2-b^2+c^2-d^2&2cd-2ab        \\ 2bd-2ac        &2ab+2cd        &a^2-b^2-c^2+d^2\\ \end{pmatrix}

(Compare the equivalent general formula for a 3 × 3 rotation matrix in terms of the axis and the angle.)

(Matrix is valid for opposite sense rotation (e.g., right-handed rotation on a left-handed coordinate system). For same-sense rotation, transpose the matrix.)

See also: Charts on SO(3), Euler angles, axis angle

[edit] Pairs of unit quaternions as rotations in 4D space

A pair of unit quaternions zl and zr can represent any rotation in 4D space. Given a four dimensional vector v, and pretending that it is a quaternion, we can rotate the vector v like this:

f(v)=z_lvz_r= \begin{pmatrix} a_l&-b_l&-c_l&-d_l\\ b_l&a_l&-d_l&c_l\\ c_l&d_l&a_l&-b_l\\ d_l&-c_l&b_l&a_l \end{pmatrix}\begin{pmatrix} a_r&-b_r&-c_r&-d_r\\ b_r&a_r&d_r&-c_r\\ c_r&-d_r&a_r&b_r\\ d_r&c_r&-b_r&a_r \end{pmatrix}\begin{pmatrix} w\\x\\y\\z \end{pmatrix}

It is straightforward to check that for each matrix M MT = I, that is, that each matrix (and hence both matrices together) represents a rotation. Note that since (zl v) zr = zl (v zr), the two matrices must commute. Therefore, there are two commuting subgroups of the set of four dimensional rotations. Arbitrary four dimensional rotations have 6 degrees of freedom, each matrix represents 3 of those 6 degrees of freedom.

Since an infinitesimal four-dimensional rotation can be represented by a pair of quaternions (as follows), all (non-infinitesimal) four-dimensional rotations can also be represented.

z_lvz_r=\begin{pmatrix} 1      &-dt_{ab}&-dt_{ac}&-dt_{ad}\\ dt_{ab}&1       &-dt_{bc}&-dt_{bd}\\ dt_{ac}& dt_{bc}&1       &-dt_{cd}\\ dt_{ad}& dt_{bd}& dt_{cd}&1 \end{pmatrix}\begin{pmatrix} w\\ x\\ y\\ z \end{pmatrix}

z_l= \left(1+{dt_{ab}+dt_{cd}\over 2}i+{dt_{ac}-dt_{bd}\over 2}j+{dt_{ad}+dt_{bc}\over 2}k\right)

z_r= \left(1+{dt_{ab}-dt_{cd}\over 2}i+{dt_{ac}+dt_{bd}\over 2}j+{dt_{ad}-dt_{bc}\over 2}k\right)

[edit] See also

[edit] References

  1. ^ Quaternions and rotation Sequences: a Primer with Applications to Orbits, Aerospace, and Virtual Reality. Kuipers, Jack B., Princeton University Press copyright 1999.

[edit] External links and resources

In other languages

Static Wikipedia (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2007 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -

Static Wikipedia 2006 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu

Static Wikipedia February 2008 (no images)

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu