|
The PhysicsLibrary quaternion collection is organized as an engineering and physics learning path rather than as a purely algebraic development. It begins with notation and convention discipline, establishes the quaternion algebra needed for computation, develops three-dimensional rotation and attitude representations, and then proceeds to angular rate kinematics, relative attitude, and inertial measurement unit propagation.
The collection is intended for students and practitioners in mechanics, rigid-body dynamics, spacecraft attitude determination and control, inertial navigation, robotics, simulation, and related fields. The deeper algebraic structure of quaternions remains important, but the first objective is to make quaternion formulas unambiguous and usable in physical applications.
Quaternion literature contains several independent convention choices. The collection therefore establishes a common convention before applying any formula. Unless an article explicitly states otherwise, PhysicsLibrary uses:
- right-handed orthonormal physical frames;
- positive physical rotation according to the right-hand screw rule;
- Hamilton multiplication,
 |
(1) |
- scalar-first display notation,
 |
(2) |
- active vector rotation by a unit quaternion,
 |
(3) |
- frame quaternion notation in which
maps coordinates from frame to frame .
Scalar-last storage such as
is treated as a common data layout, not as a different quaternion algebra. Likewise, the informal terms “right-handed quaternion” and “left-handed quaternion” are not used as the primary definition of a multiplication convention because those labels are historically overloaded.
The detailed convention discussion belongs in quaternion conventions for physics and engineering.
The material naturally falls into three stages.
- Conventions and algebra. Begin with quaternion conventions for physics and engineering, then read quaternion, quaternion product, quaternion conjugate, quaternion norm, and quaternion inverse.
- Rotations and attitude representations. Continue with axis angle representation and unit quaternion, rotating vectors with quaternions, composition of rotations and quaternion order, quaternions and direction cosine matrices, and quaternions and Euler angles.
- Dynamics, estimation, and IMU propagation. Finish the main engineering path with quaternion kinematics and angular velocity, relative attitude and error quaternions, and numerical quaternion propagation and IMU attitude state integration.
Beginning with the axis angle article, each main article also has a separate self study companion. Those companions state the exercises first and place the complete worked solutions afterward.
Quaternion conventions for physics and engineering should normally be read before applying quaternion rotation formulas from an unfamiliar source. It separates convention choices that are often conflated: Hamilton versus flipped multiplication, scalar-first versus scalar-last storage, active versus passive rotation, frame direction, and handedness terminology.
The practical diagnostic is equation level rather than terminology level. For example,
 |
(4) |
identifies Hamilton multiplication in the convention used by this collection.
Quaternion is the canonical PhysicsLibrary definition entry for the mathematical object. It defines
 |
(5) |
and develops the Hamilton basis rules, scalar and vector parts, distributivity, associativity, and noncommutativity.
When a later entry needs to define the mathematical object itself, this is the natural link target. The conventions article instead supplies the interpretation rules needed to compare formulas from different sources.
Quaternion product in scalar vector form connects quaternion algebra directly to familiar vector operations. If
and
, then
 |
(6) |
For pure vector quaternions this reduces to
 |
(7) |
This entry is especially useful for engineers because it exposes the dot and cross products hidden inside the Hamilton product.
Three separate definition entries build the algebraic tools needed by rotation formulas:
Their central relationship is
 |
(8) |
which leads to
 |
(9) |
for every nonzero quaternion. For a unit quaternion,
 |
(10) |
The definitions are kept separate so later articles can link precisely to the concept they require.
Axis angle representation and unit quaternion derives the fundamental rotation parameterization
 |
(11) |
The article explains why the quaternion contains the half angle, connects the formula to the quaternion exponential, discusses the equivalent pair and , and treats small angle behavior.
Its self study companion is axis angle representation and unit quaternion: examples, exercises, and solutions.
Rotating vectors with quaternions derives
 |
(12) |
for unit and shows that the result is exactly Rodrigues' rotation formula:
 |
(13) |
It also gives vector only implementation formulas that avoid explicitly forming pure vector quaternions.
Its companion is rotating vectors with quaternions: examples, exercises, and solutions.
Composition of rotations and quaternion order shows why finite rotations do not commute. If acts first and acts second under the active convention, then
 |
(14) |
The article also develops frame chains and intrinsic versus extrinsic rotation language.
Its companion is composition of rotations and quaternion order: examples, exercises, and solutions.
Quaternions and direction cosine matrices derives the rotation matrix associated with a unit quaternion. In compact form,
![$\displaystyle \boxed{ R(q)= (q_w^2-\mathbf q^T\mathbf q)I_3 +2\mathbf q\mathbf q^T +2q_w[\mathbf q]_{\times}. }$ $\displaystyle \boxed{ 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/1111/l2h/img26.png) |
(15) |
The article develops the component matrix, the interpretation of its columns, the relation
 |
(16) |
and matrix to quaternion recovery. It also emphasizes that
 |
(17) |
Its companion is quaternions and direction cosine matrices: examples, exercises, and solutions.
Quaternions and Euler angles uses the 3-2-1 yaw-pitch-roll sequence as the primary example. The declared active convention is
 |
(18) |
with quaternion composition
 |
(19) |
The article gives forward and inverse conversion formulas and explains the 3-2-1 singularity at
 |
(20) |
Its companion is quaternions and Euler angles: examples, exercises, and solutions.
Quaternion kinematics and angular velocity connects quaternion attitude to measured or modeled angular rate. For , body resolved angular velocity satisfies
 |
(21) |
whereas inertial resolved angular velocity satisfies
 |
(22) |
The article derives both forms, explains why the multiplication side changes, and presents matrix forms useful for software and estimation.
Its companion is quaternion kinematics and angular velocity: examples, exercises, and solutions.
Relative attitude and error quaternions develops the rotation from an actual attitude to a desired or reference attitude. For actual attitude and desired attitude , two common multiplicative error definitions are
 |
(23) |
and
 |
(24) |
They describe the same physical relative rotation with the error expressed in different coordinates. For a small local error,
![$\displaystyle \boxed{ \delta q \approx \begin{bmatrix} 1\\ [1mm] \dfrac12\delta\boldsymbol\theta \end{bmatrix}. }$ $\displaystyle \boxed{ \delta q \approx \begin{bmatrix} 1\\ [1mm] \dfrac12\delta\boldsymbol\theta \end{bmatrix}. }$](https://images.physicslibrary.org/cache/objects/1111/l2h/img39.png) |
(25) |
This is the bridge to multiplicative attitude filters and quaternion based control.
Its companion is relative attitude and error quaternions: examples, exercises, and solutions.
Numerical quaternion propagation and IMU attitude state integration turns the continuous kinematic equation into an executable sensor driven state update. A typical body gyro propagation chain is
 |
(26) |
For one constant rate sample,
![$\displaystyle \boxed{ \delta q = \begin{bmatrix} \cos(\Delta\theta/2)\\ [1mm] \dfrac{\sin(\Delta\theta/2)}{\Delta\theta} \Delta\boldsymbol\theta \end{bmatrix}. }$ $\displaystyle \boxed{ \delta q = \begin{bmatrix} \cos(\Delta\theta/2)\\ [1mm] \dfrac{\sin(\Delta\theta/2)}{\Delta\theta} \Delta\boldsymbol\theta \end{bmatrix}. }$](https://images.physicslibrary.org/cache/objects/1111/l2h/img41.png) |
(27) |
For a very small sample increment,
![$\displaystyle \delta q \approx \begin{bmatrix} 1\\ [1mm] \dfrac12\Delta\boldsymbol\theta \end{bmatrix}.$ $\displaystyle \delta q \approx \begin{bmatrix} 1\\ [1mm] \dfrac12\Delta\boldsymbol\theta \end{bmatrix}.$](https://images.physicslibrary.org/cache/objects/1111/l2h/img42.png) |
(28) |
The article distinguishes this propagation approximation from the local error state approximation used in the relative attitude article. It also covers bias correction, Euler and Runge Kutta propagation, exact exponential updates, coning, sign continuity, and the use of the propagated quaternion to rotate accelerometer specific force inside a strapdown navigation state.
Its companion is numerical quaternion propagation and IMU attitude state integration: examples, exercises, and solutions.
The complete article sequence is appropriate for a reader who wants a systematic treatment. Shorter paths are useful for specific goals.
A compact route is:
- quaternion conventions for physics and engineering;
- quaternion;
- quaternion conjugate, quaternion norm, and quaternion inverse;
- axis angle representation and unit quaternion;
- rotating vectors with quaternions;
- quaternions and direction cosine matrices.
This route establishes conventions, unit quaternions, vector rotation, and the matrix connection without immediately requiring dynamics or estimation.
After the rotation articles, continue with quaternions and Euler angles, quaternion kinematics and angular velocity, and relative attitude and error quaternions. This adds human readable Euler angles, angular rate kinematics, and relative attitude error.
The most direct application path emphasizes axis angle representation and unit quaternion, rotating vectors with quaternions, quaternions and direction cosine matrices, quaternion kinematics and angular velocity, relative attitude and error quaternions, and numerical quaternion propagation and IMU attitude state integration. The kinematics article supplies the continuous rate equation, the relative attitude article supplies the small multiplicative error representation, and the numerical propagation article applies both ideas to sampled gyro measurements and a propagated quaternion state.
Beginning with axis angle representation and unit quaternion, read each main entry and then immediately work its companion before moving on. The companion articles are:
- axis angle representation and unit quaternion: examples, exercises, and solutions;
- rotating vectors with quaternions: examples, exercises, and solutions;
- composition of rotations and quaternion order: examples, exercises, and solutions;
- quaternions and direction cosine matrices: examples, exercises, and solutions;
- quaternions and Euler angles: examples, exercises, and solutions;
- quaternion kinematics and angular velocity: examples, exercises, and solutions;
- relative attitude and error quaternions: examples, exercises, and solutions;
- numerical quaternion propagation and IMU attitude state integration: examples, exercises, and solutions.
The following equations form a compact map of the collection:
 |
 |
|
definition |
|
 |
 |
|
product |
|
 |
 |
|
inverse |
|
 |
 |
|
axis angle |
|
 |
 |
|
vector rotation |
|
 |
 |
|
successive active rotations |
|
 |
 |
|
matrix representation |
|
 |
 |
|
3-2-1 Euler sequence |
|
 |
 |
|
body rate kinematics |
|
 |
 |
|
body resolved attitude error |
|
 |
![$\displaystyle \approx[1,\tfrac12\delta\boldsymbol\theta^T]^T,$ $\displaystyle \approx[1,\tfrac12\delta\boldsymbol\theta^T]^T,$](https://images.physicslibrary.org/cache/objects/1111/l2h/img74.png) |
|
small local error |
|
 |
 |
|
body gyro IMU propagation |
|
This formula map is not a substitute for the individual derivations. Its purpose is to show how the definitions and applications are connected.
Several relationships recur throughout the collection:
- A quaternion is more general than a rotation quaternion. The definition article develops the algebra; the axis angle article introduces the unit quaternions used for spatial rotation.
- Storage order is not multiplication convention. Scalar-first and scalar-last arrays can represent the same Hamilton quaternion.
- Active and passive descriptions must be separated. A physical vector rotation and a coordinate transformation can describe the same geometry with inverse operations.
- Quaternion order follows physical composition. Finite rotations are noncommutative, so factor order must be derived from the declared mapping.
- The unit quaternion and rotation matrix carry the same orientation information. The map is two to one because
and produce the same matrix.
- Euler angles are useful coordinates, not a globally nonsingular orientation representation. Quaternions are preferable for propagation and estimation.
- A full quaternion state and a three component attitude error are complementary. The nominal state can remain global while its estimator error is locally linearized.
- IMU propagation is finite rotation composition. Gyro samples produce small quaternion increments whose multiplication order, bias correction, and noncommutativity matter in real strapdown systems.
The present collection intentionally reaches engineering applications before pursuing the deeper algebra. A later mathematical branch can build from the quaternion and axis angle representation and unit quaternion articles toward division algebras, the geometry of the unit three sphere, , the double covering of , Lie groups and
Lie algebras, and exponential and logarithmic maps. Those topics explain why the engineering formulas have the structure they do, but they are not prerequisites for beginning quaternion attitude work.
The PhysicsLibrary quaternion collection is designed so that each article has a clear linking role. Quaternion is the canonical definition of the mathematical object, while quaternion conventions for physics and engineering is the convention reference. The algebra articles establish multiplication, conjugation, norm, and inverse. The rotation articles develop axis angle, vector rotation, composition, direction cosine matrices, and Euler angles. The later engineering articles carry those ideas into angular rate kinematics, relative attitude and estimation errors,
and sampled IMU state propagation.
A reader who follows the collection should be able not only to quote quaternion formulas, but also to determine what a formula means, identify its convention, derive its multiplication order, test it against simple rotations, and use it consistently in a physical or numerical application.
This article is an original synthesis prepared for PhysicsLibrary and intended for release under CC BY-SA 4.0.
|