You are previewing The Morgan Kaufmann Series in Interactive 3D Technology: Visualizing Quaternions.
O'Reilly logo
The Morgan Kaufmann Series in Interactive 3D Technology: Visualizing Quaternions

Book Description

Introduced 160 years ago as an attempt to generalize complex numbers to higher dimensions, quaternions are now recognized as one of the most important concepts in modern computer graphics. They offer a powerful way to represent rotations and compared to rotation matrices they use less memory, compose faster, and are naturally suited for efficient interpolation of rotations. Despite this, many practitioners have avoided quaternions because of the mathematics used to understand them, hoping that some day a more intuitive description will be available.
The wait is over. Andrew Hanson's new book is a fresh perspective on quaternions. The first part of the book focuses on visualizing quaternions to provide the intuition necessary to use them, and includes many illustrative examples to motivate why they are important-a beautiful introduction to those wanting to explore quaternions unencumbered by their mathematical aspects. The second part covers the all-important advanced applications, including quaternion curves, surfaces, and volumes. Finally, for those wanting the full story of the mathematics behind quaternions, there is a gentle introduction to their four-dimensional nature and to Clifford Algebras, the all-encompassing framework for vectors and quaternions.

* Richly illustrated introduction for the developer, scientist, engineer, or student in computer graphics, visualization, or entertainment computing.
* Covers both non-mathematical and mathematical approaches to quaternions.
* Companion website with an assortment of quaternion utilities and sample code, data sets for the book's illustrations, and Mathematica notebooks with essential algebraic utilities.

Table of Contents

  1. Copyright
    1. Dedication
  2.  
  3. The Morgan Kaufmann Series in Interactive 3D Technology
  4. About the Author
  5. Foreword
  6. Preface
  7. Acknowledgments
  8. I. Elements of Quaternions
    1. 01. The Discovery of Quaternions
      1. 1.1. Hamilton’s Walk
      2. 1.2. Then Came Octonions
      3. 1.3. The Quaternion Revival
    2. 02. Folklore of Rotations
      1. 2.1. The Belt Trick
      2. 2.2. The Rolling Ball
      3. 2.3. The Apollo 10 Gimbal-Lock Incident
      4. 2.4. 3D Game Developer’s Nightmare
      5. 2.5. The Urban Legend of the Upside-down F16
      6. 2.6. Quaternions to the Rescue
    3. 03. Basic Notation
      1. 3.1. Vectors
      2. 3.2. Length of a Vector
      3. 3.3. 3D Dot Product
      4. 3.4. 3D Cross Product
      5. 3.5. Unit Vectors
      6. 3.6. Spheres
      7. 3.7. Matrices
      8. 3.8. Complex Numbers
    4. 04. What Are Quaternions?
    5. 05. Road Map to Quaternion Visualization
      1. 5.1. The Complex Number Connection
      2. 5.2. The Cornerstones of Quaternion Visualization
    6. 06. Fundamentals of Rotations
      1. 6.1. 2D Rotations
        1. 6.1.1. Relation to Complex Numbers
        2. 6.1.2. The Half-angle Form
        3. 6.1.3. Complex Exponential Version
      2. 6.2. Quaternions and 3D Rotations
        1. 6.2.1. Construction
        2. 6.2.2. Quaternions and Half Angles
        3. 6.2.3. Double Values
      3. 6.3. Recovering θ and
      4. 6.4. Euler Angles and Quaternions
      5. 6.5. † Optional Remarks
        1. 6.5.1. † Connections to Group Theory
        2. 6.5.2. † “Pure” Quaternion Derivation
        3. 6.5.3. † Quaternion Exponential Version
      6. 6.6. Conclusion
    7. 07. Visualizing Algebraic Structure
      1. 7.1. Algebra of Complex Numbers
        1. 7.1.1. Complex Numbers
        2. 7.1.2. Abstract View of Complex Multiplication
        3. 7.1.3. Restriction to Unit-length Case
      2. 7.2. Quaternion Algebra
        1. 7.2.1. The Multiplication Rule
        2. 7.2.2. Scalar Product
        3. 7.2.3. Modulus of the Quaternion Product
        4. 7.2.4. Preservation of the Unit Quaternions
    8. 08. Visualizing Spheres
      1. 8.1. 2D: Visualizing an Edge-on Circle
        1. 8.1.1. Trigonometric Function Method
        2. 8.1.2. Complex Variable Method
        3. 8.1.3. Square Root Method
      2. 8.2. The Square Root Method
      3. 8.3. 3D: Visualizing a Balloon
        1. 8.3.1. Trigonometric Function Method
        2. 8.3.2. Square Root Method
      4. 8.4. 4D: Visualizing Quaternion Geometry on S3
        1. 8.4.1. Seeing the Parameters of a Single Quaternion
        2. 8.4.2. Hemispheres in S3
    9. 09. Visualizing Logarithms and Exponentials
      1. 9.1. Complex Numbers
      2. 9.2. Quaternions
    10. 10. Visualizing Interpolation Methods
      1. 10.1. Basics of Interpolation
        1. 10.1.1. Interpolation Issues
        2. 10.1.2. Gram-Schmidt Derivation of the SLERP
        3. 10.1.3. † Alternative Derivation
      2. 10.2. Quaternion Interpolation
      3. 10.3. Equivalent 3×3 Matrix Method
    11. 11. Looking at Elementary Quaternion Frames
      1. 11.1. A Single Quaternion Frame
      2. 11.2. Several Isolated Frames
      3. 11.3. A Rotating Frame Sequence
      4. 11.4. Synopsis
    12. 12. Quaternions and the Belt Trick: Connecting to the Identity
      1. 12.1. Very Interesting, but Why?
        1. 12.1.1. The Intuitive Answer
        2. 12.1.2. † The Technical Answer
      2. 12.2. The Details: How Quaternion Visualization Explains the Belt Trick
      3. 12.3. Frame-sequence Visualization Methods
        1. 12.3.1. One Rotation
        2. 12.3.2. Two Rotations
        3. 12.3.3. Synopsis
    13. 13. Quaternions and the Rolling Ball: Exploiting Order Dependence
      1. 13.1. Order Dependence
      2. 13.2. The Rolling Ball Controller
      3. 13.3. Rolling Ball Quaternions
      4. 13.4. † Commutators
      5. 13.5. Three Degrees of Freedom From Two
    14. 14. Quaternions and Gimbal Lock: Limiting the Available Space
      1. 14.1. Guidance System Suspension
      2. 14.2. Mathematical Interpolation Singularities
      3. 14.3. Quaternion Viewpoint
  9. II. Advanced Quaternion Topics
    1. 15. Alternative Ways of Writing Quaternions
      1. 15.1. Hamilton’s Generalization of Complex Numbers
      2. 15.2. Pauli Matrices
      3. 15.3. Other Matrix Forms
    2. 16. Efficiency and Complexity Issues
      1. 16.1. Extracting a Quaternion
        1. 16.1.1. Positive Trace R
        2. 16.1.2. Nonpositive Trace R
      2. 16.2. Efficiency of Vector Operations
    3. 17. Advanced Sphere Visualization
      1. 17.1. Projective Method
        1. 17.1.1. The Circle S1
        2. 17.1.2. General SN Polar Projection
      2. 17.2. Distance-preserving Flattening Methods
        1. 17.2.1. Unroll-and-Flatten S1
        2. 17.2.2. S2 Flattened Equal-Area Method
        3. 17.2.3. S3 Flattened Equal-volume Method
    4. 18. More on Logarithms and Exponentials
      1. 18.1. 2D Rotations
      2. 18.2. 3D Rotations
      3. 18.3. Using Logarithms for Quaternion Calculus
      4. 18.4. Quaternion Interpolations Versus Log
    5. 19. Two-Dimensional Curves
      1. 19.1. Orientation Frames for 2D Space Curves
        1. 19.1.1. 2D Rotation Matrices
        2. 19.1.2. The Frame Matrix in 2D
        3. 19.1.3. Frame Evolution in 2D
      2. 19.2. What Is a Map?
      3. 19.3. Tangent and Normal Maps
      4. 19.4. Square Root Form
        1. 19.4.1. Frame Evolution in (a, b)
        2. 19.4.2. Simplifying the Frame Equations
    6. 20. Three-Dimensional Curves
      1. 20.1. Introduction to 3D Space Curves
      2. 20.2. General Curve Framings in 3D
      3. 20.3. Tubing
      4. 20.4. Classical Frames
        1. 20.4.1. Frenet–Serret Frame
        2. 20.4.2. Parallel Transport Frame
        3. 20.4.3. Geodesic Reference Frame
        4. 20.4.4. General Frames
      5. 20.5. Mapping the Curvature and Torsion
      6. 20.6. Theory of Quaternion Frames
        1. 20.6.1. Generic Quaternion Frame Equations
        2. 20.6.2. Quaternion Frenet Frames
        3. 20.6.3. Quaternion Parallel Transport Frames
      7. 20.7. Assigning Smooth Quaternion Frames
        1. 20.7.1. Assigning Quaternions to Frenet Frames
        2. 20.7.2. Assigning Quaternions to Parallel Transport Frames
      8. 20.8. Examples: Torus Knot and Helix Quaternion Frames
      9. 20.9. Comparison of Quaternion Frame Curve Lengths
    7. 21. 3D Surfaces
      1. 21.1. Introduction to 3D Surfaces
        1. 21.1.1. Classical Gauss Map
        2. 21.1.2. Surface Frame Evolution
        3. 21.1.3. Examples of Surface Framings
      2. 21.2. Quaternion Weingarten Equations
        1. 21.2.1. Quaternion Frame Equations
        2. 21.2.2. Quaternion Surface Equations (Weingarten Equations)
      3. 21.3. Quaternion Gauss Map
      4. 21.4. Example: The Sphere
        1. 21.4.1. Quaternion Maps of Alternative Sphere Frames
        2. 21.4.2. Covering the Sphere and the Geodesic Reference Frame South Pole Singularity
      5. 21.5. Examples: Minimal Surface Quaternion Maps
    8. 22. Optimal Quaternion Frames
      1. 22.1. Background
      2. 22.2. Motivation
      3. 22.3. Methodology
        1. 22.3.1. The Space of Possible Frames
        2. 22.3.2. Parallel Transport and Minimal Measure
      4. 22.4. The Space of Frames
        1. 22.4.1. Full Space of Curve Frames
        2. 22.4.2. Full Space of Surface Maps
      5. 22.5. Choosing Paths in Quaternion Space
        1. 22.5.1. Optimal Path Choice Strategies
        2. 22.5.2. General Remarks on Optimization in Quaternion Space
      6. 22.6. Examples
        1. 22.6.1. Minimal Quaternion Frames for Space Curves
        2. 22.6.2. Minimal-quaternion-area Surface Patch Framings
    9. 23. Quaternion Volumes
      1. 23.1. Three-degree-of-freedom Orientation Domains
      2. 23.2. Application to the Shoulder Joint
      3. 23.3. Data Acquisition and the Double-covering Problem
        1. 23.3.1. Sequential Data
        2. 23.3.2. The Sequential Nearest-neighbor Algorithm
        3. 23.3.3. The Surface-based Nearest-neighbor Algorithm
        4. 23.3.4. The Volume-based Nearest-neighbor Algorithm
      4. 23.4. Application Data
    10. 24. Quaternion Maps of Streamlines
      1. 24.1. Visualization Methods
        1. 24.1.1. Direct Plot of Quaternion Frame Fields
        2. 24.1.2. Similarity Measures for Quaternion Frames
        3. 24.1.3. Exploiting or Ignoring Double Points
      2. 24.2. 3D Flow Data Visualizations
        1. 24.2.1. AVS Streamline Example
        2. 24.2.2. Deforming Solid Example
      3. 24.3. Brushing: Clusters and Inverse Clusters
      4. 24.4. Advanced Visualization Approaches
        1. 24.4.1. 3D Rotations of Quaternion Displays
        2. 24.4.2. Probing Quaternion Frames with 4D Light
    11. 25. Quaternion Interpolation
      1. 25.1. Concepts of Euclidean Linear Interpolation
        1. 25.1.1. Constructing Higher-order Polynomial Splines
        2. 25.1.2. Matching
        3. 25.1.3. Schlag’s Method
        4. 25.1.4. Control-point Method
      2. 25.2. The Double Quad
      3. 25.3. Direct Interpolation of 3D Rotations
        1. 25.3.1. Relation to Quaternions
        2. 25.3.2. Method for Arbitrary Origin
        3. 25.3.3. Exponential Version
        4. 25.3.4. Special Vector-Vector Case
        5. 25.3.5. Multiple-level Interpolation Matrices
        6. 25.3.6. Equivalence of Quaternion and Matrix Forms
      4. 25.4. Quaternion Splines
      5. 25.5. Quaternion de Casteljau Splines
      6. 25.6. Equivalent Anchor Points
      7. 25.7. Angular Velocity Control
      8. 25.8. Exponential-map Quaternion Interpolation
      9. 25.9. Global Minimal Acceleration Method
        1. 25.9.1. Why a Cubic?
        2. 25.9.2. Extension to Quaternion Form
    12. 26. Quaternion Rotator Dynamics
      1. 26.1. Static Frame
      2. 26.2. Torque
      3. 26.3. Quaternion Angular Momentum
    13. 27. Concepts of the Rotation Group
      1. 27.1. Brief Introduction to Group Representations
        1. 27.1.1. Complex Versus Real
        2. 27.1.2. What Is a Representation?
      2. 27.2. Basic Properties of Spherical Harmonics
        1. 27.2.1. Representations and Rotation-invariant Properties
        2. 27.2.2. Properties of Expansion Coefficients Under Rotations
    14. 28. Spherical Riemannian Geometry
      1. 28.1. Induced Metric on the Sphere
      2. 28.2. Induced Metrics of Spheres
        1. 28.2.1. S1 Induced Metrics
        2. 28.2.2. S2 Induced Metrics
        3. 28.2.3. S3 Induced Metrics
        4. 28.2.4. Toroidal Coordinates on S3
        5. 28.2.5. Axis-angle Coordinates on S3
        6. 28.2.6. General form for the Square-root Induced Metric
      3. 28.3. Elements of Riemannian Geometry
      4. 28.4. Riemann Curvature of Spheres
        1. 28.4.1. S1
        2. 28.4.2. S2
        3. 28.4.3. S3
      5. 28.5. Geodesics and Parallel Transport on the Sphere
      6. 28.6. Embedded-vector Viewpoint of the Geodesics
  10. III. Beyond Quaternions
    1. 29. The Relationship of 4D Rotations to Quaternions
      1. 29.1. What Happened in Three Dimensions
      2. 29.2. Quaternions and Four Dimensions
    2. 30. Quaternions and the Four Division Algebras
      1. 30.1. Division Algebras
        1. 30.1.1. The Number Systems with Dimensions 1, 2, 4, and 8
        2. 30.1.2. Parallelizable Spheres
      2. 30.2. Relation to Fiber Bundles
      3. 30.3. Constructing the Hopf Fibrations
        1. 30.3.1. Real: S0 fiber + S1 base = S1 bundle
        2. 30.3.2. Complex: S1 fiber + S2 base = S3 bundle
        3. 30.3.3. Quaternion: S3 fiber + S4 base = S7 bundle
        4. 30.3.4. Octonion: S7 fiber + S8 base = S15 bundle
    3. 31. Clifford Algebras
      1. 31.1. Introduction to Clifford Algebras
      2. 31.2. Foundations
        1. 31.2.1. Clifford Algebras and Rotations
        2. 31.2.2. Higher-dimensional Clifford Algebra Rotations
      3. 31.3. Examples of Clifford Algebras
        1. 31.3.1. 1D Clifford Algebra
        2. 31.3.2. 2D Clifford Algebra
        3. 31.3.3. 2D Rotations Done Right
        4. 31.3.4. 3D Clifford Algebra
        5. 31.3.5. Clifford Implementation of 3D Rotations
      4. 31.4. Higher Dimensions
      5. 31.5. Pin(N), Spin(N), O(N), SO(N), and All That...
    4. 32. Conclusions
  11. Appendices
    1. A. Notation
      1. A.1. Vectors
      2. A.2. Length of a Vector
      3. A.3. Unit Vectors
      4. A.4. Polar Coordinates
      5. A.5. Spheres
      6. A.6. Matrix Transformations
      7. A.7. Features of Square Matrices
      8. A.8. Orthogonal Matrices
      9. A.9. Vector Products
        1. A.9.1. 2D Dot Product
        2. A.9.2. 2D Cross Product
        3. A.9.3. 3D Dot Product
        4. A.9.4. 3D Cross Product
      10. A.10. Complex Variables
    2. B. 2D Complex Frames
    3. C. 3D Quaternion Frames
      1. C.1. Unit Norm
      2. C.2. Multiplication Rule
      3. C.3. Mapping to 3D rotations
      4. C.4. Rotation Correspondence
      5. C.5. Quaternion Exponential Form
    4. D. Frame and Surface Evolution
      1. D.1. Quaternion Frame Evolution
      2. D.2. Quaternion Surface Evolution
    5. E. Quaternion Survival Kit
    6. F. Quaternion Methods
      1. F.1. Quaternion Logarithms and Exponentials
      2. F.2. The Quaternion Square Root Trick
      3. F.3. The â → Formula Simplified
      4. F.4. Gram–Schmidt Spherical Interpolation
      5. F.5. Direct Solution for Spherical Interpolation
      6. F.6. Converting Linear Algebra to Quaternion Algebra
      7. F.7. Useful Tensor Methods and Identities
        1. F.7.1. Einstein Summation Convention
        2. F.7.2. Kronecker Delta
        3. F.7.3. Levi-Civita Symbol
    7. G. Quaternion Path Optimization Using Surface Evolver
    8. H. Quaternion Frame Integration
    9. I. Hyperspherical Geometry
      1. I.1. Definitions
      2. I.2. Metric Properties
  12. References