Physics Library
 An open source physics library
Encyclopedia | Forums | Docs | Random | Template Test |  
Login
create new user
Username:
Password:
forget your password?
Main Menu
Sections

Meta

Talkback

Downloads

Information
[parent] example of composition of rotations and quaternion order (Example)

Composition of Rotations and Quaternion Order: Examples, Exercises, and Solutions

This companion article belongs to the PhysicsLibrary entry composition of rotations and quaternion order. All exercises are stated first. Complete solutions appear only after the exercise section so that the article is self-study friendly.

Convention declaration

We use right-handed frames, Hamilton multiplication, scalar-first display notation, and the active rotation rule

$\displaystyle \mathbf v'=q\mathbf v q^*$ (1)
for unit quaternions. If $q_1$ acts first and $q_2$ acts second, then the net quaternion is
$\displaystyle q_{\mathrm{net}}=q_2q_1.$ (2)

Exercises

Exercise 1

Show directly from the active rotation formula that if $q_1$ acts first and $q_2$ acts second, then the net quaternion is $q_2q_1$.

Exercise 2

Let
$\displaystyle q_z=\frac{1+\mathbf k}{\sqrt2}$ (3)
represent a $+90^\circ$ rotation about the $z$ axis, and let
$\displaystyle q_x=\frac{1+\mathbf i}{\sqrt2}$ (4)
represent a $+90^\circ$ rotation about the $x$ axis. Starting from $\mathbf v=\mathbf j$, compute the final vector when the order is first $q_z$ then $q_x$.

Exercise 3

Repeat Exercise 2 but reverse the order: first $q_x$ then $q_z$. Compare the result with Exercise 2.

Exercise 4

Using
$\displaystyle q_x=\frac{1+\mathbf i}{\sqrt2}, \qquad q_y=\frac{1+\mathbf j}{\sqrt2},$ (5)
start from $\mathbf v=\mathbf k$ and verify that first $q_x$ then $q_y$ gives $-\mathbf j$, while first $q_y$ then $q_x$ gives $\mathbf i$.

Exercise 5

Let
$\displaystyle q_1=\cos\frac{\alpha}{2}+\widehat{\mathbf u}\sin\frac{\alpha}{2}, \qquad q_2=\cos\frac{\beta}{2}+\widehat{\mathbf u}\sin\frac{\beta}{2}$ (6)
be rotations about the same unit axis $\widehat{\mathbf u}$. Show that
$\displaystyle q_2q_1=\cos\frac{\alpha+\beta}{2}+\widehat{\mathbf u}\sin\frac{\alpha+\beta}{2}.$ (7)

Exercise 6

Suppose $q$ is unit. Show that applying $q$ and then $q^*$ gives the identity rotation.

Exercise 7

A software library stores quaternions as $[q_x,q_y,q_z,q_w]^T$. Does that fact alone change the composition rule for active rotations? Explain briefly.

Exercise 8

Write the frame-chain rule for ${}^{N}q_A$ and ${}^{A}q_B$, and derive ${}^{N}q_B$.

Exercise 9

Explain the difference between an intrinsic $z$-then-$x$ sequence and an extrinsic $z$-then-$x$ sequence.

Exercise 10

Show that if $R(q)$ is the active rotation matrix associated with $q$, then
$\displaystyle R(q_2q_1)=R(q_2)R(q_1).$ (8)

Exercise 11

Let
$\displaystyle q_1=\frac{1+\mathbf i}{\sqrt2}, \qquad q_2=\frac{1+\mathbf j}{\sqrt2}.$ (9)
Compute the explicit quaternion products $q_2q_1$ and $q_1q_2$ and verify that they differ.

Exercise 12

Give a passive-rotation formula corresponding to the active sequence “first $q_1$, then $q_2$”.

Exercise 13

Why do small-angle rotations often appear to commute in first-order linearized attitude-error models even though finite rotations do not commute exactly?

Exercise 14

Let
$\displaystyle q_1=\frac{1+\mathbf k}{\sqrt2}, \qquad q_2=\frac{1-\mathbf k}{\sqrt2}.$ (10)
Find $q_2q_1$ and interpret the result physically.

Exercise 15

A student says, “Since multiplication is associative, the order of quaternion rotations does not matter.” Identify the mistake in this statement.

Solutions

Solution 1

If $q_1$ acts first, then $\mathbf v_1=q_1\mathbf v q_1^*$. If $q_2$ acts next, then
$\displaystyle \mathbf v_2=q_2\mathbf v_1 q_2^*=q_2(q_1\mathbf v q_1^*)q_2^*.$ (11)
By associativity,
$\displaystyle \mathbf v_2=(q_2q_1)\mathbf v(q_1^*q_2^*).$ (12)
Since $(q_2q_1)^*=q_1^*q_2^*$,
$\displaystyle \mathbf v_2=(q_2q_1)\mathbf v(q_2q_1)^*.$ (13)
Hence the net quaternion is $q_2q_1$.

Solution 2

First rotate $\mathbf j$ about $z$ by $+90^\circ$:
$\displaystyle q_z\mathbf j q_z^*=-\mathbf i.$ (14)
Then rotate $-\mathbf i$ about $x$ by $+90^\circ$. A vector on the $x$ axis is unchanged, so
$\displaystyle q_x(-\mathbf i)q_x^*=-\mathbf i.$ (15)
Therefore the final vector is $-\mathbf i$.

Solution 3

First rotate $\mathbf j$ about $x$ by $+90^\circ$:
$\displaystyle q_x\mathbf j q_x^*=\mathbf k.$ (16)
Then rotate $\mathbf k$ about $z$ by $+90^\circ$. A vector on the $z$ axis is unchanged, so the final vector remains $\mathbf k$. This differs from the result of Exercise 2, so the order matters.

Solution 4

Using the standard axis rotations,
$\displaystyle q_x\mathbf k q_x^*=-\mathbf j.$ (17)
Rotating $-\mathbf j$ about $y$ leaves it unchanged, so first $q_x$ then $q_y$ gives $-\mathbf j$. Also,
$\displaystyle q_y\mathbf k q_y^*=\mathbf i,$ (18)
and rotating $\mathbf i$ about $x$ leaves it unchanged. So first $q_y$ then $q_x$ gives $\mathbf i$.

Solution 5

Because both quaternions use the same axis $\widehat{\mathbf u}$,
\begin{equation*}\begin{aligned} q_2q_1 &=\left(\cos\frac{\beta}{2}+\widehat{\ma... ...} +\cos\frac{\beta}{2}\sin\frac{\alpha}{2} \right), \end{aligned}\end{equation*}
where $\widehat{\mathbf u}^{\,2}=-1$. The angle-addition formulas then give
$\displaystyle q_2q_1=\cos\frac{\alpha+\beta}{2}+\widehat{\mathbf u}\sin\frac{\alpha+\beta}{2}.$ (20)

Solution 6

The net quaternion is
$\displaystyle q^*q=qq^*=1,$ (21)
so the second rotation exactly undoes the first. Therefore the composition is the identity rotation.

Solution 7

No. Scalar-last is only a storage convention. The composition rule depends on the algebra and the rotation interpretation, not on memory layout. For active rotations with Hamilton multiplication, if $q_1$ acts first and $q_2$ acts second, the net quaternion is still $q_2q_1$.

Solution 8

The frame-chain rule is
$\displaystyle \boxed{{}^{N}q_B={}^{N}q_A{}^{A}q_B.}$ (22)
It is derived by substituting the map from $B$ to $A$ into the map from $A$ to $N$ and regrouping, exactly as for successive active rotations.

Solution 9

In an extrinsic $z$-then-$x$ sequence, both rotations are taken about axes fixed in the reference frame. In an intrinsic $z$-then-$x$ sequence, the second rotation is about the body's current $x$ axis after the first rotation has already occurred. The axis labels can therefore refer to different physical axes in the two descriptions.

Solution 10

For any vector $\mathbf v$,
$\displaystyle R(q_2q_1)\mathbf v=(q_2q_1)\mathbf v(q_2q_1)^*=q_2(q_1\mathbf v q_1^*)q_2^*=R(q_2)R(q_1)\mathbf v.$ (23)
Since this holds for every $\mathbf v$, the matrices are equal:
$\displaystyle R(q_2q_1)=R(q_2)R(q_1).$ (24)

Solution 11

Compute
\begin{equation*}\begin{aligned} q_2q_1 &=\frac{1}{2}(1+\mathbf j)(1+\mathbf i)\... ...\ &=\frac{1}{2}(1+\mathbf i+\mathbf j-\mathbf k), \end{aligned}\end{equation*}
because $\mathbf j\mathbf i=-\mathbf k$. Similarly,
$\displaystyle q_1q_2=\frac{1}{2}(1+\mathbf i+\mathbf j+\mathbf k).$ (26)
The products differ, so the corresponding rotations differ.

Solution 12

The passive formula is obtained by using the inverse action. If $q_1$ acts first and $q_2$ acts second in the active sense, then the passive coordinate change uses
$\displaystyle \mathbf v_{\mathrm{passive}}=(q_2q_1)^*\mathbf v(q_2q_1)=q_1^*q_2^*\mathbf v q_2q_1.$ (27)

Solution 13

In a first-order small-angle model, products of two small rotation increments are second-order quantities and are neglected. The noncommutativity is then invisible at first order. For finite rotations, those higher-order terms are not negligible, so the order matters.

Solution 14

Since $q_2=q_1^*$,
$\displaystyle q_2q_1=q_1^*q_1=1.$ (28)
The net effect is no rotation. The second quarter-turn exactly cancels the first.

Solution 15

Associativity means that one may regroup factors without changing their order, for example $(q_2q_1)q_0=q_2(q_1q_0)$. It does not mean one may swap the order of factors. Commutativity would be the property $q_2q_1=q_1q_2$, and that property fails in general for finite rotations.

License

This article is an original synthesis prepared for PhysicsLibrary and intended for release under CC BY-SA 4.0.



"example of composition of rotations and quaternion order" is owned by bloftin.
(view preamble)
View style:

This object's parent.

Cross-references: commutativity, reference frame, commute, quaternion products, matrix, composition, identity, vector, formula, quaternions, section, composition of rotations and quaternion order

This is version 1 of example of composition of rotations and quaternion order, born on 2026-08-23.
Object id is 1100, canonical name is ExampleOfCompositionOfRotationsAndQuaternionOrder.
Accessed 7 times total.

Classification:
Physics Classification02.40.Yy (Geometric mechanics )
 02.10.Hh (Rings and algebras)
 45.40.-f (Dynamics and kinematics of rigid bodies)
Pending Errata and Addenda
None.
Discussion
Style: Expand: Order:

No messages.

Interact
rate | post | correct | update request | add example | add (any)