|
|
|
Main Menu
|
|
Sections
Meta
Talkback
Downloads
Information
|
|
|
|
|
example of rotating vectors with quaternions
|
(Example)
|
|
|
This entry is the self-study companion to the PhysicsLibrary article rotating vectors with quaternions. The convention throughout is Hamilton multiplication in a right-handed frame, with scalar-first quaternion display and active vector rotation
 |
(1) |
The quaternion is assumed to have unit norm unless a problem states otherwise.
- Pure-quaternion representation. Write the vector
as a scalar-first pure quaternion.
about . Use quaternion multiplication to rotate
through about . Show every quaternion multiplication step.
about . Rotate
through about and determine the resulting Cartesian vector.
- A vector parallel to the axis. Let
What physical rotation does
represent? Apply it to
and explain the result geometrically.
- Rotation through
. Rotate
through about .
- A symmetric
rotation. Let
Construct and show that the active rotation sends
- Rodrigues formula. Using
evaluate the rotated vector using Rodrigues' formula.
- Quaternion sign ambiguity. Prove directly that
and rotate every vector identically under the sandwich action.
- Inverse rotation. If
prove that
- Norm preservation. Use quaternion norm multiplicativity to prove that a unit quaternion preserves the Euclidean magnitude of every rotated vector.
- Deriving Rodrigues' formula. Starting from
derive
- Vector-only implementation. Show that, for a unit quaternion
,
Then rewrite it using
- Active versus passive. A fixed physical vector has coordinates
in frame
. Frame is obtained by rotating the coordinate axes about relative to . Using the same unit quaternion that would actively rotate vectors by about , determine the coordinates
.
- Scalar-first and scalar-last software arrays. The quaternion for a
rotation about is displayed in PhysicsLibrary scalar-first form as
Write the same quaternion in scalar-last storage. Explain whether the Hamilton multiplication law changes.
- Debugging the wrong sandwich order. A program intends to actively rotate
by about , but it computes
Predict the output and explain the error.
- Nonunit quaternion pitfall. Let
where
is unit. Show that
Explain why a nonunit quaternion should not be used with the conjugate sandwich formula when a pure rotation is intended.
The scalar part is zero, so
 |
(2) |
The rotation quaternion is
First,
Then
Therefore
 |
(5) |
By the right-hand rule, a positive quarter-turn about carries toward . Thus
 |
(6) |
The quaternion is
Direct multiplication gives the same result.
The quaternion phase is , so the physical rotation angle is
The axis is . Since
is parallel to the axis,
 |
(7) |
A rotation leaves every vector on its own axis unchanged.
A rotation about reverses the and components and leaves the component unchanged. Therefore
 |
(8) |
Since
we obtain
 |
(9) |
Using Rodrigues' formula with
and
gives
 |
(10) |
Thus this rotation cyclically carries the coordinate axes
.
For
,
and
With
and
,
Hence
 |
(12) |
Because
,
 |
(13) |
Therefore
 |
(14) |
Start with
Multiply on the left by and on the right by :
Thus
 |
(16) |
For unit ,
Hence
So quaternion conjugation by a unit quaternion preserves Euclidean vector length.
Let
The first product is
 |
(18) |
Multiplication by
cancels the scalar part and gives
Using
produces
 |
(20) |
Write
. Expanding the sandwich product and collecting cross-product terms gives
 |
(21) |
If
 |
(22) |
then
 |
(23) |
The active quaternion for about is
A passive coordinate change uses the inverse action,
For
,
 |
(24) |
Therefore the fixed vector has coordinates
![$\displaystyle \boxed{ [0,-1,0]^T }$ $\displaystyle \boxed{ [0,-1,0]^T }$](https://images.physicslibrary.org/cache/objects/1098/l2h/img121.png) |
(25) |
in the rotated frame.
Scalar-first storage is
Scalar-last storage places the scalar at the end:
![$\displaystyle \boxed{ \left[0,0,\frac{\sqrt2}{2},\frac{\sqrt2}{2}\right]^T. }$ $\displaystyle \boxed{ \left[0,0,\frac{\sqrt2}{2},\frac{\sqrt2}{2}\right]^T. }$](https://images.physicslibrary.org/cache/objects/1098/l2h/img123.png) |
(26) |
The Hamilton multiplication law does not change. Only the array indexing changes.
The expression
applies the inverse rotation. Therefore the output is
 |
(27) |
The intended active formula was
.
With ,
Therefore
 |
(28) |
Thus
 |
(29) |
The conjugate sandwich formula represents a pure rotation only when the orientation quaternion is unit. A nonunit quaternion should be normalized, or the true inverse should be used if a general quaternion similarity transform is intended.
The rotation law is cross-checked against the public-domain treatments of Joly and Hathaway, both of which use the classical rotator
. The problems and worked solutions here are newly written for PhysicsLibrary.
- 1
- C. J. Joly, A Manual of Quaternions, Macmillan and Co., London, 1905. Public-domain historical source.
- 2
- A. S. Hathaway, A Primer of Quaternions, 1896. Public-domain text; Project Gutenberg edition and LATEX source available. Project Gutenberg edition
Unless otherwise noted, this PhysicsLibrary entry is intended for release under the Creative Commons Attribution–ShareAlike 4.0 International license.
| "example of rotating vectors with quaternions" is owned by bloftin.(view preamble)
|
|
| Keywords: |
quaternion, vector rotation, unit quaternion, Rodrigues formula, pure quaternion, active rotation, passive rotation, exercises, worked solutions |
This object's parent.
Cross-references: conjugation, scalar, program, magnitude, quaternion norm, formula, quaternion multiplication, representation, norm, vector, quaternion, rotating vectors with quaternions
This is version 1 of example of rotating vectors with quaternions, born on 2026-08-23.
Object id is 1098, canonical name is ExampleOfRotatingVectorsWithQuaternions.
Accessed 10 times total.
Classification:
|
|
|
|
|
|
|
|
Pending Errata and Addenda
|
|
|
|
|
|
|
|
|
|
|