|
|
|||||||
Thus
![]() Substitution into the quaternion to DCM formula gives
Now
![]() Therefore
![]() Hence
The physical vector is fixed; only its coordinate description changed.
Solution 2: passive
|
![]() | (13) |
The corresponding DCM is
![]() | (14) |
Apply it to

Then
![]() | (15) |
Thus a fixed vector originally along +yA has coordinates along −zB after the positive x frame rotation.
For

we have

The DCM is
![]() | (16) |
Every term in the DCM formula is quadratic in the quaternion components. Replacing each component by its negative therefore leaves every matrix entry unchanged.
Hence
![]() | (17) |
The two quaternions represent the same orientation.
For

we already found

The conjugate is

Its matrix is
![]() | (18) |
Clearly,
![]() | (19) |
If q = Bq A, then

Thus C(q) maps A coordinates into B coordinates, while C(q∗) maps B coordinates back into A coordinates.
The DCM is

Its trace is

Therefore

Now


and

Thus
![]() | (20) |
This is the passive quaternion for a positive 90∘ frame rotation about +z.
The equivalent quaternion −q represents the same DCM.
rotationThe trace is

The scalar component would therefore satisfy

The simple off diagonal formulas divide by 4qw, so they are unusable in this case.
The largest diagonal expression is associated with qx:

Thus

while

One valid quaternion is
![]() | (21) |
Under the PhysicsLibrary passive convention,

It represents a positive 180∘ frame rotation about +x.
The equivalent quaternion +i produces the same DCM because a 180∘ rotation about +x is also equivalent to a 180∘ rotation about −x.
The axis is unit because

For

the half angle is 30∘. Therefore

The passive quaternion is
![]() | (22) |
Substitution into the DCM formula gives
![]() | (23) |
For the DCM in Exercise 7,

Therefore

Using the off diagonal differences,



Hence the recovered quaternion is
![]() | (24) |
which is exactly the original quaternion.
The negative of this quaternion is an equally valid round trip result.
The DCM is

Its first column is

so

Its second column is

so

Its third column is

so

Therefore
![]() | (25) |
The quaternion chain is

From the preceding composition article,
![]() | (26) |
The individual DCMs are
![]() | (27) |
and
![]() | (28) |
Multiply:

Direct conversion of

gives the same matrix:
![]() | (29) |
Thus
![]() | (30) |
From Solution 3,

Its transpose is

Then
![]() | (31) |
This particular matrix is a cyclic permutation matrix. Its determinant is
![]() | (32) |
Therefore it is a proper direction cosine matrix.
PhysicsLibrary defines the positive 90∘ frame rotation about +z by

Its passive A → B DCM is

Therefore Library A matches the PhysicsLibrary passive coordinate convention.
Library B returns its transpose:

That matrix can be interpreted as the reverse passive map

or as the positive active vector rotation matrix for the same +90∘ physical geometry.
The numbers alone do not determine the semantic interpretation; the declared map direction is required.
The first test is orthogonality:
![]() | (33) |
The second test is proper handedness:
![]() | (34) |
The tolerance should be chosen according to the expected numerical error in the application.
Quaternion extraction formulas assume that the matrix already represents a proper orientation. A matrix with significant scaling, shear, or reflection can still produce real numbers when substituted into component formulas, but those numbers need not represent the intended physical attitude.
Therefore matrix validity should be checked before conversion.
PhysicsLibrary scalar first storage is

Scalar last storage of the same quaternion is
![]() | (35) |
Since

and

the quaternion is approximately

Therefore it represents a positive passive frame rotation of
![]() | (36) |
about +z.
Changing storage order does not change the quaternion algebra or the physical map. Software must merely place the correct semantic components into the correct indices before applying its DCM conversion routine.
The quaternion chain is
![]() | (37) |
The matching DCM chain is
![]() | (38) |
The reverse DCM is
![]() | (39) |
If Ig is known, then the body coordinates are
![]() | (40) |
The equivalent quaternion expression is
![]() | (41) |
Substituting the frame chain explicitly gives
![]() | (42) |
Quaternion and DCM chains therefore preserve the same frame ordering.
| Test | PhysicsLibrary passive result |
Positive frame rotation about ![]() | q = (1 − k)∕ |
| Corresponding DCM | |
-frame coordinates | -frame coordinates |
| Reverse map | C(q∗) = C(q)T |
| Quaternion sign | C(−q) = C(q) |
| Frame composition | C(pq) = C(p)C(q) |
| Valid DCM | CT C = I, det C = +1 |
The exercises and solutions in this companion are newly written or rewritten for PhysicsLibrary under the passive frame convention.
Sommer and coauthors provide a modern convention analysis that is especially useful for distinguishing Hamilton multiplication from active and passive matrix assignments. Moore provides an openly licensed treatment of reference frames and direction cosine matrices. Henderson provides an important historical engineering reference for explicit transformations among Euler Angles, quaternions, and transformation matrices.
[1] H. Sommer, I. Gilitschenski, M. Bloesch, S. Weiss, R. Siegwart, and J. Nieto, “Why and How to Avoid the Flipped Quaternion Multiplication,” Aerospace, vol. 5, no. 3, article 72, 2018. Published under CC BY 4.0. Publisher article
[2] J. K. Moore, Learn Multibody Dynamics, chapter “Orientation of Reference Frames.” Distributed under CC BY 4.0. Learn Multibody Dynamics
[3] D. M. Henderson, Euler Angles, Quaternions, and Transformation Matrices: Working Relationships, JSC-12960, NASA Johnson Space Center, Mission Planning and Analysis Division, 1977. Engineering reference. NASA Technical Reports Server search
[4] W. R. Hamilton, Elements of Quaternions, 2nd ed., edited by C. J. Joly, Longmans, Green, and Co., 1899. Public domain historical source. Internet Archive scan
Unless otherwise noted, this PhysicsLibrary entry is intended for release under the Creative Commons Attribution ShareAlike 4.0 International license.
| Physics Classification: | 02.40.Yy (Geometric mechanics ) |
| 02.10.Hh (Rings and algebras) | |
| 45.40.-f (Dynamics and kinematics of rigid bodies) |
None.
No messages.