|
|
|
Main Menu
|
|
Sections
Meta
Talkback
Downloads
Information
|
|
|
|
|
example of quaternions and direction cosine matrices
|
(Example)
|
|
|
This companion article belongs to the PhysicsLibrary entry quaternions and direction cosine matrices. All exercises are stated first. Complete solutions appear only after the exercise section so that the article is self study friendly.
We use right-handed frames, Hamilton multiplication, scalar-first display notation, and the active rotation rule
 |
(1) |
for unit quaternions. Passive coordinate changes are represented by the associated DCM relation
 |
(2) |
Starting from the vector rotation formula
 |
(3) |
derive the compact matrix formula for .
Expand the compact formula to obtain the component matrix
 |
(4) |
For
 |
(5) |
compute .
Using the matrix from Exercise 3, compute the images of
,
, and
.
Show directly from the compact matrix formula that
.
Show that for a unit quaternion,
 |
(6) |
Let
 |
(7) |
Find .
Let
 |
(8) |
Compute and interpret the result geometrically.
Show that the columns of are the images of
,
, and
.
Write the passive DCM relation for the frame chain
and derive
 |
(9) |
Suppose
 |
(10) |
Recover a quaternion representing this rotation.
Given the proper rotation matrix
 |
(11) |
find a quaternion representing it and explain why the trace formula using is numerically delicate here.
Show that if is unit, then is orthogonal and has determinant .
Explain the difference between the active matrix relation
and the passive DCM relation
.
A software package stores quaternions in scalar-last order. A student copies the scalar-first matrix formula without changing the component mapping. Describe the error and how to fix it.
Write the three terms separately:
 |
(12) |
 |
(13) |
and
![$\displaystyle 2q_w(\mathbf q\times\mathbf v)=2q_w[\mathbf q]_\times\mathbf v.$ $\displaystyle 2q_w(\mathbf q\times\mathbf v)=2q_w[\mathbf q]_\times\mathbf v.$](https://images.physicslibrary.org/cache/objects/1102/l2h/img33.png) |
(14) |
Adding the three contributions gives
![$\displaystyle R(q)= (q_w^2-\mathbf q^T\mathbf q)I_3 + 2\mathbf q\mathbf q^T + 2q_w[\mathbf q]_\times.$ $\displaystyle R(q)= (q_w^2-\mathbf q^T\mathbf q)I_3 + 2\mathbf q\mathbf q^T + 2q_w[\mathbf q]_\times.$](https://images.physicslibrary.org/cache/objects/1102/l2h/img34.png) |
(15) |
Insert
 |
(16) |
into the compact matrix formula and expand entry by entry. Using
simplifies the diagonal terms, yielding the stated matrix.
For
and , so
 |
(17) |
The columns are the images of the basis vectors, so
 |
(18) |
Thus the axis rotates into , the axis rotates into , and the axis is unchanged.
Replacing by changes to and to
. The terms in the matrix become
 |
(19) |
 |
(20) |
and
![$\displaystyle 2(-q_w)[-\mathbf q]_\times = 2q_w[\mathbf q]_\times.$ $\displaystyle 2(-q_w)[-\mathbf q]_\times = 2q_w[\mathbf q]_\times.$](https://images.physicslibrary.org/cache/objects/1102/l2h/img54.png) |
(21) |
Hence
.
A unit quaternion satisfies
. The inverse active rotation matrix is therefore the transpose of the forward matrix. More directly, quaternion conjugation corresponds to reversing the rotation, so
 |
(22) |
Here ,
, and . Therefore,
 |
(23) |
This is the matrix for a active rotation about the axis.
Here
 |
(24) |
Substituting into the component formula gives
 |
(25) |
This cyclically permutes the coordinate axes:
,
, and
.
For any matrix ,
 |
(26) |
Applying this to shows that its columns are exactly the rotated basis vectors.
The passive chain is
 |
(27) |
Substituting the second relation into the first gives
 |
(28) |
so
 |
(29) |
The matrix is the active rotation about the axis, so one choice is
 |
(30) |
The equally valid choice represents the same matrix.
The matrix is a rotation about the axis, so one choice is
 |
(31) |
The trace is , so the formula
 |
(32) |
returns . Dividing by is therefore numerically dangerous. One must instead use a branch based on the large value of .
For a unit quaternion the corresponding map is a proper rotation, so it preserves dot products and orientation. Hence the matrix is orthogonal and has determinant . Algebraically one can verify
 |
(33) |
from the compact formula or from the fact that the inverse rotation is given by .
The active formula
rotates the vector itself in a fixed basis. The passive formula
changes the coordinates used to describe the same geometric vector. The same orientation change may be described either way, but the physical interpretation is different.
The student has confused storage layout with component meaning. In the scalar-first formula, the first symbol is the scalar component . If a library stores
, the entries must be remapped before the formula is used. Otherwise the resulting matrix corresponds to a different quaternion.
This article is an original synthesis prepared for PhysicsLibrary and intended for release under CC BY-SA 4.0.
| "example of quaternions and direction cosine matrices" is owned by bloftin.(view preamble)
|
|
This object's parent.
Cross-references: scalar, dot products, conjugation, determinant, trace, matrix, formula, vector, relation, quaternions, section, quaternions and direction cosine matrices
This is version 1 of example of quaternions and direction cosine matrices, born on 2026-08-24.
Object id is 1102, canonical name is ExampleOfQuaternionsAndDirectionCosineMatrices.
Accessed 5 times total.
Classification:
|
|
|
|
|
|
|
|
Pending Errata and Addenda
|
|
|
|
|
|
|
|
|
|
|