Quaternion kinematics and angular velocity: examples, exercises, and solutions
This companion article belongs to the PhysicsLibrary entry quaternion kinematics and angular
velocity. All exercises are stated first. Complete solutions appear only after the exercise section so
that the article is self study friendly.
1 Convention declaration
We use the attitude quaternion q = Iq
B, Hamilton multiplication, scalar-first display notation,
and
for body resolved angular velocity, while
for inertial resolved angular velocity.
2 Exercises
Exercise 1
Starting from a short time body frame rotation increment, derive
Exercise 2
Starting from an inertial frame rotation increment, derive
Exercise 3
Show that the body resolved and inertial resolved equations are equivalent if
Exercise 4
Let
and let the body resolved angular velocity be
Compute q.
Exercise 5
For the same attitude in Exercise 4, find the inertial resolved angular velocity ωI and verify that
the inertial rate equation gives the same q.
Exercise 6
Derive the scalar and vector equations
Exercise 7
Derive the 4 × 4 right multiplication rate matrix ΩR(ω) for scalar-first ordering.
Exercise 8
Derive the 4 × 4 left multiplication rate matrix ΩL(ω) for scalar-first ordering.
Exercise 9
Prove that the continuous quaternion kinematic equation preserves the norm of a unit
quaternion.
Exercise 10
Starting from q(0) = 1, let
be constant. Find q(t) exactly.
Exercise 11
For the angular rate in Exercise 10, compute the exact quaternion after Δt = 0.5 s.
Exercise 12
Use one forward Euler step with Δt = 0.5 s for Exercise 10. Compute the norm of the
unnormalized result and compare it with the exact quaternion.
Exercise 13
A body mounted gyro reports
for Δt = 0.01 s. Form the first order incremental quaternion.
Exercise 14
Explain why replacing an attitude trajectory q(t) by −q(t) requires replacing q(t) by −q(t) but
does not change the physical motion.
Exercise 15
A program stores quaternions scalar last and uses the body rate matrix written for scalar-first
ordering without permuting the state. Explain the resulting bug and how to correct
it.
Exercise 16
A programmer uses
for a quaternion q = Iq
B driven by body resolved gyro measurements. What is wrong, and
what symptom would you expect for rotations not aligned with a principal coordinate
axis?
3 Solutions
Solution 1
Over dt, the body frame incremental rotation is
Since it is resolved about the current body axes, it composes on the right:
Thus
and taking dt → 0 gives
Solution 2
For an inertial resolved increment,
and the increment composes on the left:
Therefore
Solution 3
Using
and q∗q = 1,
Multiplying by 1∕2 proves that the two kinematic equations are identical.
Solution 4
Write
Then
because ki = j. Hence
Solution 5
The attitude is a +90∘ rotation about z, so a body frame +x vector is mapped into inertial +y.
Therefore
Then
which gives exactly the same q as Exercise 4.
Solution 6
Using the scalar vector Hamilton product,
Multiplying by 1∕2 gives the required scalar and vector equations.
Solution 7
Expanding qωB in scalar-first ordering gives
Thus q4 = (1∕2)ΩRq4.
Solution 8
Expanding ωIq gives
Thus q4 = (1∕2)ΩLq4.
Solution 9
Both ΩR and ΩL are skew symmetric. Therefore
Hence the exact continuous equation preserves ∥q∥.
Solution 10
The angular speed magnitude is 0.4 rad∕s and the axis is k. Therefore
The physical rotation angle is 0.4t radians.
Solution 11
At t = 0.5 s,
Thus
or numerically
Solution 12
At q0 = 1,
A forward Euler step gives
Its norm is
The exact quaternion from Exercise 11 has norm exactly one.
Solution 13
The first order increment is
Therefore
Solution 14
If q(t) satisfies the kinematic equation, multiplying the entire trajectory by −1 gives the same
physical orientation because q and −q represent the same rotation. Differentiating −q(t) gives
−q(t). The kinematic equation is linear in q, so the sign reversed pair remains a valid solution
describing the same physical motion.
Solution 15
The matrix sign pattern assumes the state order [qw,qx,qy,qz]T . A scalar-last array uses a different
ordering, so direct multiplication associates the wrong coefficients with the wrong state
components. The state and matrix must be permuted consistently, or the quaternion must be
converted to scalar-first ordering before applying the formula.
Solution 16
For q = Iq
B and body resolved gyro measurements, the correct equation is
Using ωBq treats the numerical components as though they were resolved in the inertial
frame. For single axis rotations aligned with an axis that commutes with the current
quaternion, the error can be hidden. For general three-dimensional motion, the attitude will
propagate with incorrect coupling and sign behavior because quaternion multiplication is not
commutative.
License
This article is an original synthesis prepared for PhysicsLibrary and intended for release under CC
BY-SA 4.0.