120
Visualizing Quaternions Course Notes for S IGGRAPH 2007 Andrew J. Hanson Computer Science Department Indiana University Bloomington, IN 47405 USA Email: [email protected] Abstract This intermediate-level tutorial provides a comprehensive approach to the visualization of quater- nions and their relationships to computer graphics and scientific visualization. The introduction focuses on a selection of everyday phenomena involving rotating objects whose explanation is es- sentially impossible without a quaternion visualization. The presentation will then pursue selected examples of quaternion-based visualization methods to help explain the behavior of quaternion manifolds: quaternion representations of orientation frames attached to curves, surfaces, and vol- umes. Presenter’s Biography Andrew J. Hanson is a professor of computer science at Indiana University, and has regularly taught courses in computer graphics, computer vision, and scientific visualization. He received a BA in chemistry and physics from Harvard College in 1966 and a PhD in theoretical physics from MIT in 1971. Before coming to Indiana University, he did research in theoretical physics at the Institute for Advanced Study, Stanford, and Berkeley, and then in computer vision at the SRI Artificial Intelligence Center in Menlo Park, CA. He has published in IEEE Computer, CG&A, TVCG, ACM Computing Surveys, and has over a dozen papers in the IEEE Visualization Proceedings. He has also contributed three articles to the Graphics Gems series dealing with user interfaces for rotations and with techniques of N-dimensional geometry. Previous experi- ence with conference tutorials includes a Siggraph ’98 tutorial on N-dimensional graphics, a Visualization ’98 course on Clifford Algebras and Quaternions, and tutorials on Visualizing Quaternions presented at Siggraph 1999, Siggraph 2000, at Siggraph 2001 in tandem with a course on Visualizing Relativity for a graphics audience, and again at Siggraph 2005. Major research interests include scientific visualization, machine vision, computer graphics, perception, and the design of interactive user interfaces for virtual re- ality and visualization applications. Particular visualization applications currently being studied include astrophysical visualizations, interactive interfaces for very large scales such as astrophysics and cosmology, and the exploitation of constrained navigation for visualization environments. Mathematical visualization interests include the development of interactive high-dimensional geometry visualization, multimedia haptic 1

Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

  • Upload
    others

  • View
    6

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Visualizing Quaternions

Course Notes for SIGGRAPH 2007

Andrew J. HansonComputer Science Department

Indiana UniversityBloomington, IN 47405 USAEmail: [email protected]

AbstractThis intermediate-level tutorial provides a comprehensive approach to the visualization of quater-nions and their relationships to computer graphics and scientific visualization. The introductionfocuses on a selection of everyday phenomena involving rotating objects whose explanation is es-sentially impossible without a quaternion visualization. The presentation will then pursue selectedexamples of quaternion-based visualization methods to help explain the behavior of quaternionmanifolds: quaternion representations of orientation frames attached to curves, surfaces, and vol-umes.

Presenter’s BiographyAndrew J. Hanson is a professor of computer science at Indiana University, and has regularly taught coursesin computer graphics, computer vision, and scientific visualization. He received a BA in chemistry andphysics from Harvard College in 1966 and a PhD in theoretical physics from MIT in 1971. Before comingto Indiana University, he did research in theoretical physics at the Institute for Advanced Study, Stanford,and Berkeley, and then in computer vision at the SRI Artificial Intelligence Center in Menlo Park, CA. Hehas published in IEEE Computer, CG&A, TVCG, ACM Computing Surveys, and has over a dozen papersin the IEEE Visualization Proceedings. He has also contributed three articles to the Graphics Gems seriesdealing with user interfaces for rotations and with techniques of N-dimensional geometry. Previous experi-ence with conference tutorials includes a Siggraph ’98 tutorial on N-dimensional graphics, a Visualization’98 course on Clifford Algebras and Quaternions, and tutorials on Visualizing Quaternions presented atSiggraph 1999, Siggraph 2000, at Siggraph 2001 in tandem with a course on Visualizing Relativity for agraphics audience, and again at Siggraph 2005. Major research interests include scientific visualization,machine vision, computer graphics, perception, and the design of interactive user interfaces for virtual re-ality and visualization applications. Particular visualization applications currently being studied includeastrophysical visualizations, interactive interfaces for very large scales such as astrophysics and cosmology,and the exploitation of constrained navigation for visualization environments. Mathematical visualizationinterests include the development of interactive high-dimensional geometry visualization, multimedia haptic

1

Page 2: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces, and the general problems of graphics and visualization in dimensions greaterthan three and their applications to mathematics and theoretical physics.

ContentsAbstract 1

Presenter’s Biography 1

Contents 2

General Information 3

1 Overview 4

2 Twisting Belts, Rolling Balls, and Locking Gimbals 4

3 Quaternion Fields 4

4 Demonstration Software 5

References 5

Slides: I: Twisting Belts, Rolling Balls, and Locking Gimbals

Slides: II: Quaternion Fields

Paper: “Constrained Optimal Framings of Curves and Surfaces using Quaternion Gauss

Maps,” Andrew J. Hanson

Paper: IUCS Technical Report 518: “Quaternion Gauss Maps and Optimal Framings of

Curves and Surfaces,” Andrew J. Hanson

Paper: “Quaternion Frame Approach to Streamline Visualization,” A.J. Hanson and H. Ma

2

Page 3: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

General Information on the Tutorial

Course SyllabusSummary: This tutorial will deal with visualizable representations of quaternions, their fea-tures, technology, folklore, and applications. The introduction will focus on visually understand-ing quaternions themselves by exploiting parallels to complex variables and 2D rotations. Startingfrom this basis, the tutorial will proceed to give visualizations of advanced quaternion applications.

Prerequisites: Participants should be comfortable with and have an appreciation for conven-tional mathematical methods of 3D computer graphics and geometry used in geometric transfor-mations and polygon rendering. The material will be of most interest to those wishing to deepentheir intuitive understanding of moving coordinate frames and quaternion-based animation tech-niques.

Objectives: Participants will learn the basic facts relating quaternions to ordinary 3D rotations,as well as methods for examining the properties of quaternion constructions using interactive visu-alization methods. A variety of applications, including the use of quaternions to samples coordinateframes for curves, surfaces, and volumes, will be explored.

Outline: This tutorial will last approximately two hours including a break and time for questionsand discussion. The material will be arranged as follows:

I. (50 min + questions) Twisting Belts, Rolling Balls, and Locking Gimbals: ExplainingRotation Sequences with Quaternions

Sequences of orientations are manifestly evident in our everyday lives. While we can im-mediately observe strange things that happen when we twist a leather belt, roll a baseball, orpush on a gyroscope, if you ask “why” and expect a real explanation, most of us hit a deadend. Quaternion visualization provides satisfying answers to such questions. Interactivedemonstrations are provided.

II. (50 min + questions) Quaternion Fields: Curves, Surfaces, and Volumes

Once we have mastered the visualization of quaternion paths, we have the tools to take a freshlook at many problems in graphics and visualization. The quaternion field is a continuousmap from a set of orientation frames such as framed curves, surfaces, and volumes intothe corresponding quaternions. We examine a family of examples showing how quaternioncurves, surfaces, and volumes can solve old problems and reveal new properties. Examplesinclude general approaches to textured tubings.

3

Page 4: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

1 OverviewPractitioners of computer graphics and animation frequently represent 3D rotations using thequaternion formalism, a mathematical tool that originated with William Rowan Hamilton in the19th century, and is now an essential part of modern analysis, group theory, differential geometry,and even quantum physics. Quaternions are in many ways very simple, and yet there are enormoussubtleties to address in the process of fully understanding and exploiting their properties. Thepurpose of this Tutorial is to construct an intuitive bridge between our intuitions about 2D and 3Drotations and the quaternion representation.

The Tutorial will begin with an introduction to various natural phenomena that can be under-stood using quaternions. Rotations in 2D, which will be found to have surprising richness, willlead the way to the construction of the relation between 3D rotations and quaternions. Quater-nion visualization methods of various sorts will be introduced, followed by applications of thequaternion frame representation to problems of interest by graphicists and visualization scientists.An extensive bibliography of related literature is included, as well as several relevant reprints andtechnical reports, a Mathematica implementation of the Quaternion Frenet Equations, and a basicGLUT quaternion visualization application.

2 Twisting Belts, Rolling Balls, and Locking GimbalsWe will begin with a basic introduction to the ways in which sequences of rotations enter ourlives in surprising ways. We will then proceed to look at a variety of methods for understandingquaternions and making meaningful pictures of constructs involving them. These methods willrange from some of the concepts pointed out by Hart, Francis, and Kauffman [54] to theoreticalmethods given in [47, 48, 40, 51].

Traditional treatments of quaternions range from the original works of Hamilton and Tait [35,85] to a variety of recent studies such as those of Altmann, Pletincks, Juttler, and Kuipers [2, 73,63, 67].

In our pedagogical treatment, we will focus on the use of 2D rotations as a rich but algebraicallysimple proving ground in which we can see many of the key features of quaternion geometryin a very manageable context. The relationship between 3D rotations and quaternions is thenintroduced as a natural extension of the 2D systems. Quaternion visualization itself utilizes a basictrick: since a four-vector quaternion ����������� � obeying ��������� , then the four-vector lies onthe three-sphere S � and has only three independent components: if we display just , we can inprinciple infer the value of ������� ������� .

3 Quaternion FieldsAfter the conceptual introduction, we proceed to study the nature of quaternions as representationsof frames in 3D. The now-traditional application of quaternion animation splines was introducedto the graphics community originally by Shoemake [77]. Our visualizations of these and other

4

Page 5: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

applications exploit the fact that quaternions are points on the three-sphere embedded in 4D; thethree-sphere (S � ) is analogous to an ordinary ball or two-sphere (S � ) embedded in 3D, exceptthat the three-sphere is a solid object instead of a surface. To manipulate, display, and visualizerotations in 3D, we may convert 3D rotations to 4D quaternion points and treat the entire problemin the framework of 4D geometry.

We pursue three main applications, which involve the identification of quaternion frames withsampled curves, surfaces, and volumes. The curve methods follow closely techniques introduced inHanson and Ma [47, 48] for representing families of coordinate frames on curves in 3D as curvesin the 4D quaternion space. Interesting insights result from studying the problem of applying atexture to a tube surrounding an arbitrary open or closed curve. The extension to surfaces and thecorresponding induced surfaces in quaternion space follow the treatment by Hanson [40, 51], andvolumetric quaternions are studied using the methods of Herda, et al. [56, 57, 55].

4 Demonstration SoftwareWe provide an elementary OpenGL-based interactive quaternion visualization application,QuatRot, that should be essentially system-independent and run on any platform. In addition, wesupply our own version, quatutils.nb, of some basic Mathematica routines for quaternions(which serve as the basis for a number of the illustrations in the notes), as well as a Mathematicanotebook qfrmint.nb that explicitly implements a numerical integration of the Frenet frameequations in quaternion form, vastly improving the exactly equivalent calculation for the standardFrenet equations implemented by Gray [33].

AcknowledgmentsPortions of the course notes are adapted from the book, Visualizing Quaternions, by Andrew J.Hanson, published by Morgan Kaufmann Publishers, Copyright 2006 by Elsevier Inc. We thankthe publisher for permission to use this material; all rights not explicitly assigned to Siggraph forthe purpose of providing these course notes are reserved.

Republished in the Course Notes with permission are two key papers from IEEE Transactionson Visualization and Computer Graphics [48], and from the Proceedings of IEEE Visualization[40]; we thank the IEEE Computer Society Press for permitting us to include this material.

Finally we would like to thank the National Science Foundation for their support: the researchincorporated in portions of this work was supported in part by NSF grant CCR-0204112.

5

Page 6: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

References[1] B. Alpern, L. Carter, M. Grayson, and C. Pelkie. Orientation maps: Techniques for visual-

izing rotations (a consumer’s guide). In Proceedings of Visualization ’93, pages 183–188.IEEE Computer Society Press, 1993.

[2] S. L. Altmann. Rotations, Quaternions, and Double Groups. Oxford University Press, 1986.

[3] M.F. Atiyah, R. Bott, and A. Shapiro. Clifford modules. Topology, 3, Suppl. 1:3–38, 1986.

[4] T. Banchoff and J. Werner. Linear Algebra through Geometry. Springer-Verlag, 1983.

[5] T. F. Banchoff. Visualizing two-dimensional phenomena in four-dimensional space: A com-puter graphics approach. In E. Wegman and D. Priest, editors, Statistical Image Processingand Computer Graphics, pages 187–202. Marcel Dekker, Inc., New York, 1986.

[6] Thomas F. Banchoff. Beyond the Third Dimension: Geometry, Computer Graphics, andHigher Dimensions. Scientific American Library, New York, NY, 1990.

[7] David Banks. Interactive display and manipulation of two-dimensional surfaces in four di-mensional space. In Symposium on Interactive 3D Graphics, pages 197–207, New York,1992. ACM.

[8] David Banks. Interactive manipulation and display of two-dimensional surfaces in four-dimensional space. In David Zeltzer, editor, Computer Graphics (1992 Symposium on Inter-active 3D Graphics), volume 25, pages 197–207, March 1992.

[9] David C. Banks. Illumination in diverse codimensions. In Computer Graphics, pages 327–334, New York, 1994. ACM. Proceedings of SIGGRAPH 1994; Annual Conference Series1994.

[10] A. Barr, B. Currin, S. Gabriel, and J. Hughes. Smooth interpolation of orientations withangular velocity constraints using quaternions. In Computer Graphics Proceedings, AnnualConference Series, pages 313–320, 1992. Proceedings of SIGGRAPH ’92.

[11] Richard L. Bishop. There is more than one way to frame a curve. Amer. Math. Monthly,82(3):246–251, March 1975.

[12] Wilhelm Blaschke. Kinematik und Quaternionen. VEB Deutscher Verlag der Wis-senschaften, Berlin, 1960.

[13] Jules Bloomenthal. Calculation of reference frames along a space curve. In Andrew Glassner,editor, Graphics Gems, pages 567–571. Academic Press, Cambridge, MA, 1990.

[14] Kenneth A. Brakke. The surface evolver. Experimental Mathematics, 1(2):141–165, 1992.The “Evolver” system, manual, and sample data files are available by anonymous ftp fromgeom.umn.edu, The Geometry Center, Minneapolis MN.

6

Page 7: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

[15] D. W. Brisson, editor. Hypergraphics: Visualizing Complex Relationships in Art, Science andTechnology, volume 24. Westview Press, 1978.

[16] S. A. Carey, R. P. Burton, and D. M. Campbell. Shades of a higher dimension. ComputerGraphics World, pages 93–94, October 1987.

[17] Michael Chen, S. Joy Mountford, and Abigail Sellen. A study in interactive 3-d rotationusing 2-d control devices. In Proceedings of Siggraph 88, volume 22, pages 121–130, 1988.

[18] H.S.M. Coxeter. Regular Complex Polytopes. Cambridge University Press, second edition,1991.

[19] R. A. Cross and A. J. Hanson. Virtual reality performance for virtual geometry. In Proceed-ings of Visualization ’94, pages 156–163. IEEE Computer Society Press, 1994.

[20] A.R. Edmonds. Angular Momentum in Quantum Mechanics. Princeton University Press,Princeton, New Jersey, 1957.

[21] N.V. Efimov and E.R. Rozendorn. Linear Algebra and Multi-Dimensional Geometry. MirPublishers, Moscow, 1975.

[22] T. Eguchi, P. B. Gilkey, and A. J. Hanson. Gravitation, gauge theories and differential geom-etry. Physics Reports, 66(6):213–393, December 1980.

[23] L. P. Eisenhart. A Treatise on the Differential Geometry of Curves and Surfaces. Dover, NewYork, 1909 (1960).

[24] S. Feiner and C. Beshers. Visualizing n-dimensional virtual worlds with n-vision. ComputerGraphics, 24(2):37–38, March 1990.

[25] S. Feiner and C. Beshers. Worlds within worlds: Metaphors for exploring n-dimensionalvirtual worlds. In Proceedings of UIST ’90, Snowbird, Utah, pages 76–83, October 1990.

[26] Gerd Fischer. Mathematische Modelle, volume I and II. Friedr. Vieweg & Sohn, Braun-schweig/Wiesbaden, 1986.

[27] H. Flanders. Differential Forms. Academic Press, New York, 1963.

[28] J.D. Foley, A. van Dam, S.K. Feiner, and J.F. Hughes. Computer Graphics, Principles andPractice. Addison-Wesley, second edition, 1990. page 227.

[29] A. R. Forsyth. Geometry of Four Dimensions. Cambridge University Press, 1930.

[30] George K. Francis. A Topological Picturebook. Springer Verlag, 1987.

[31] Herbert Goldstein. Classical Mechanics. Addison-Wesley, 1950.

7

Page 8: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

[32] F.S. Grassia. Practical parameterization of rotations using the exponential map. Journal ofGraphics Tools, 3(3):29–48, 1998.

[33] Alfred Gray. Modern Differential Geometry of Curves and Surfaces. CRC Press, Inc., BocaRaton, FL, second edition, 1998.

[34] Cindy M. Grimm and John F. Hughes. Modeling surfaces with arbitrary topology usingmanifolds. In Computer Graphics Proceedings, Annual Conference Series, pages 359–368,1995. Proceedings of SIGGRAPH ’95.

[35] W.R. Hamilton. Lectures on Quaternions. Cambridge University Press, 1853.

[36] A. J. Hanson. The rolling ball. In David Kirk, editor, Graphics Gems III, pages 51–60.Academic Press, Cambridge, MA, 1992.

[37] A. J. Hanson. A construction for computer visualization of certain complex curves. Noticesof the Amer.Math.Soc., 41(9):1156–1163, November/December 1994.

[38] A. J. Hanson. Geometry for n-dimensional graphics. In Paul Heckbert, editor, GraphicsGems IV, pages 149–170. Academic Press, Cambridge, MA, 1994.

[39] A. J. Hanson. Rotations for n-dimensional graphics. In Alan Paeth, editor, Graphics GemsV, pages 55–64. Academic Press, Cambridge, MA, 1995.

[40] A. J. Hanson. Constrained optimal framings of curves and surfaces using quaternion gaussmaps. In Proceedings of Visualization ’98, pages 375–382. IEEE Computer Society Press,1998.

[41] A. J. Hanson. Visualizing Quaternions. Morgan Kaufmann, San Francisco, CA, 2006.

[42] A. J. Hanson and R. A. Cross. Interactive visualization methods for four dimensions. InProceedings of Visualization ’93, pages 196–203. IEEE Computer Society Press, 1993.

[43] A. J. Hanson and P. A. Heng. Visualizing the fourth dimension using geometry and light. InProceedings of Visualization ’91, pages 321–328. IEEE Computer Society Press, 1991.

[44] A. J. Hanson and P. A. Heng. Four-dimensional views of 3d scalar fields. In Proceedings ofVisualization ’92, pages 84–91. IEEE Computer Society Press, 1992.

[45] A. J. Hanson and P. A. Heng. Foursight. In Siggraph Video Review, volume 85. ACMSiggraph, 1992. Scene 11, Presented in the Animation Screening Room at SIGGRAPH ’92,Chicago, Illinois, July 28–31, 1992.

[46] A. J. Hanson and P. A. Heng. Illuminating the fourth dimension. Computer Graphics andApplications, 12(4):54–62, July 1992.

[47] A. J. Hanson and H. Ma. Visualizing flow with quaternion frames. In Proceedings of Visual-ization ’94, pages 108–115. IEEE Computer Society Press, 1994.

8

Page 9: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

[48] A. J. Hanson and H. Ma. Quaternion frame approach to streamline visualization. IEEETrans. on Visualiz. and Comp. Graphics, 1(2):164–174, June 1995.

[49] A. J. Hanson and H. Ma. Space walking. In Proceedings of Visualization ’95, pages 126–133.IEEE Computer Society Press, 1995.

[50] A. J. Hanson, T. Munzner, and G. K. Francis. Interactive methods for visualizable geometry.IEEE Computer, 27(7):73–83, July 1994.

[51] A.J. Hanson. Quaternion gauss maps and optimal framings of curves and surfaces. IndianaUniversity Computer Science Department Technical Report 518 (October, 1998).

[52] A.J. Hanson, K. Ishkov, and J. Ma. Meshview. A portable 4D geometry viewer written inOpenGL/Motif, available by anonymous ftp from ftp.cs.indiana.edu:pub/hanson.

[53] A.J. Hanson, K. Ishkov, and J. Ma. Meshview: Visualizing the fourth dimension. Overviewof the MeshView 4D geometry viewer.

[54] John C. Hart, George K. Francis, and Louis H. Kauffman. Visualizing quaternion rotation.ACM Trans. on Graphics, 13(3):256–276, 1994.

[55] L. Herda, R. Urtasun, and P. Fua. Hierarchical Implicit Surface Joint Limits to ConstrainVideo-Based Motion Capture. In ECCV, Prague, Czech Republic, May 2004.

[56] L. Herda, R. Urtasun, A. Hanson, and P. Fua. An Automatic Method For Determining Quater-nion Field Boundaries for Ball-and-Socket Joint Limits. In Proceedings of the 5th Interna-tional Conference on Automated Face and Gesture Recognition (FGR), pages 95–100, Wash-ington, DC, May 2002. IEEE Computer Society.

[57] L. Herda, R. Urtasun, A. Hanson, and P. Fua. Automatic Determination of Shoulder JointLimits using Experimentally Determined Quaternion Field Boundaries. International Journalof Robotics Research, 22(6):419–434, June 2003.

[58] D. Hilbert and S. Cohn-Vossen. Geometry and the Imagination. Chelsea, New York, 1952.

[59] John G. Hocking and Gail S. Young. Topology. Addison-Wesley, 1961.

[60] C. Hoffmann and J. Zhou. Some techniques for visualizing surfaces in four-dimensionalspace. Computer-Aided Design, 23:83–91, 1991.

[61] S. Hollasch. Four-space visualization of 4D objects. Master’s thesis, Arizona State Univer-sity, August 1991.

[62] H.B. Lawson Jr. and M.L. Michelsohn. Spin Geometry. Princeton University Press, 1989.

[63] B. Juttler. Visualization of moving objects using dual quaternion curves. Computers andGraphics, 18(3):315–326, 1994.

9

Page 10: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

[64] B. Juttler and M.G. Wagner. Computer-aided design with saptial rational B-spline motions.Journal of Mechanical Design, 118:193–201, June 1996.

[65] Myoung-Jun Kim, Myung-Soo Kim, and Sung Yong Shin. A general construction schemefor unit quaternion curves with simple high order derivatives. In Computer Graphics Pro-ceedings, Annual Conference Series, pages 369–376, 1995. Proceedings of SIGGRAPH ’95.

[66] F.. Klock. Two moving coordinate frames for sweeping along a 3d trajectory. ComputerAided Geometric Design, 3, 1986.

[67] J.B. Kuipers. Quaternions and Rotation Sequences. Princeton University Press, 1999.

[68] J. Milnor. Topology from the Differentiable Viewpoint. The University Press of Virginia,Charlottesville, 1965.

[69] Hans Robert Muller. Spharische Kinematik. VEB Deutscher Verlag der Wissenschaften,Berlin, 1962.

[70] G. M. Nielson. Smooth interpolation of orientations. In N.M. Thalman and D. Thalman,editors, Computer Animation ’93, pages 75–93, Tokyo, June 1993. Springer-Verlag.

[71] Michael A. Noll. A computer technique for displaying n-dimensional hyperobjects. Commu-nications of the ACM, 10(8):469–473, August 1967.

[72] Mark Phillips, Silvio Levy, and Tamara Munzner. Geomview: An interactive geometryviewer. Notices of the Amer. Math. Society, 40(8):985–988, October 1993. Available byanonymous ftp from geom.umn.edu, The Geometry Center, Minneapolis MN.

[73] D. Pletincks. Quaternion calculus as a basic tool in computer graphics. The Visual Computer,5(1):2–13, 1989.

[74] Ravi Ramamoorthi and Alan H. Barr. Fast construction of accurate quaternion splines. InTurner Whitted, editor, SIGGRAPH 97 Conference Proceedings, Annual Conference Series,pages 287–292. ACM SIGGRAPH, Addison Wesley, August 1997. ISBN 0-89791-896-7.

[75] John Schlag. Using geometric constructions to interpolate orientation with quaternions. InJames Arvo, editor, Graphics Gems II, pages 377–380. Academic Press, 1991.

[76] Uri Shani and Dana H. Ballard. Splines as embeddings for generalized cylinders. ComputerVision, Graphics, and Image Processing, 27:129–156, 1984.

[77] K. Shoemake. Animating rotation with quaternion curves. In Computer Graphics, volume 19,pages 245–254, 1985. Proceedings of SIGGRAPH 1985.

[78] K. Shoemake. Animation with quaternions. Siggraph Course Lecture Notes, 1987.

[79] Ken Shoemake. Arcball rotation control. In Paul Heckbert, editor, Graphics Gems IV, pages175–192. Academic Press, 1994.

10

Page 11: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

[80] Ken Shoemake. Fiber bundle twist reduction. In Paul Heckbert, editor, Graphics Gems IV,pages 230–236. Academic Press, 1994.

[81] D.M.Y. Sommerville. An Introduction to the Geometry of � Dimensions. Reprinted by DoverPress, 1958.

[82] N. Steenrod. The Topology of Fibre Bundles. Princeton University Press, 1951. PrincetonMathematical Series 14.

[83] K. V. Steiner and R. P. Burton. Hidden volumes: The 4th dimension. Computer GraphicsWorld, pages 71–74, February 1987.

[84] D. J. Struik. Lectures on Classical Differential Geometry. Addison-Wesley, 1961.

[85] P.G. Tait. An Elementary Treatise on Quaternions. Cambridge University Press, 1890.

[86] J. R. Weeks. The Shape of Space. Marcel Dekker, New York, 1985.

[87] S. Weinberg. Gravitation and Cosmology: Principles and Applications of General Relativity.John Wiley and Sons, 1972.

[88] E.T. Whittaker. A Treatise on the Analytical Dynamics of Particles and Rigid Bodies. Dover,New York, New York, 1944.

11

Page 12: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Visualizing Quaternions

Andrew J. Hanson

Computer Science Department

Indiana University

Siggraph 2007 Tutorial

1

Page 13: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

OUTLINE

I: (50 min) Twisting Belts, Rolling Balls,

and Locking Gimbals:

Explaining Rotation Sequences with Quaternions

II: (50 min) Quaternion Fields:

Curves, Surfaces, and Volumes

2

Page 14: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Part I

Twisting Belts, Rolling Balls, andLocking Gimbals

Explaining Rotation Sequences with Quaternions

3

Page 15: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Where Did Quaternions Come From?

. . . from the discovery of Complex Numbers:

• z = x+ iy Complex numbers = realization

that z2 + 1 = 0 cannot be solved unless you

have an “imaginary” number with i2 = −1.

• Euler’s formula: eiθ = cos θ+ i sin θ

allows you to do most of 2D geometry.

4

Page 16: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Hamilton

The first to ask “If you can do 2D geometry with complex numbers, howmight you do 3D geometry?” was William Rowan Hamilton, circa 1840.

Sir William Rowan Hamilton4 August 1805 — 2 September 1865

5

Page 17: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Hamilton’s epiphany: 16 October 1843

“An electric circuit seemed to close; and a spark flashed

forth . . . Nor could I resist the impulse – unphilosophi-

cal as it may have been – to cut with a knife on a stone

of Brougham Bridge, as we passed it, the fundamen-

tal formula with the symbols, i, j, k; namely,

i2 = j2 = k2 = ijk = −1

which contains the Solution of the Problem...”

6

Page 18: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

...at the site of Hamilton’s carving

The plaque on Broome Bridge in Dublin, Ireland, commem-orating the legendary location where Hamilton conceived ofthe idea of quaternions. (Hamilton apparently misspelled itas “Brougham Bridge” in his letter.)

7

Page 19: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

The Belt TrickQuaternion Geometry in our daily lives

• Two people hold ends of a belt.

• Twist the belt either 360 degrees or 720 de-

grees.

• Rule: Move belt ends any way you like but do

not change orientation of either end.

• Try to straighten out the belt.

8

Page 20: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

360 Degree Belt

360 twist: stays twisted, can change DIRECTION!9

Page 21: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

720 Degree Belt

720 twist: CAN FLATTEN OUT WHOLE BELT!10

Page 22: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

The Beltless TrickQuaternion Geometry is right in your hand!

• Hold a coffee cup (empty is a good idea) in the

palm of your hand.

• Keeping the cup vertical, user your hand to twist

the handle, first by 360 degrees (painful).

• Now CONTINUE another 360 degrees, for a to-

tal of 720 degrees.

• Your arm is once again STRAIGHT!

11

Page 23: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Rolling Ball Puzzle

1. Put a ball on a flat table.2. Place hand flat on top of the ball3. Make circular rubbing motion, as though polish-

ing the tabletop.4. Watch a point on the equator of the ball.5. small clockwise circles →

equator goes counterclockwise6. small counterclockwise circles →

equator goes clockwise

12

Page 24: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Rolling Ball ScenarioPoint of Contact

y axis rotation

x axis rotation

motion

in plane

13

Page 25: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Gimbal Lock

Gimbal Lock occurs when a mechanical or com-

puter system experiences an anomaly due to an

(x, y, z)-based orientation control sequence.

• Mechanical systems cannot avoid all possible gim-

bal lock situations .

• Computer orientation interpolation systems canavoid gimbal-lock-related glitches by using quater-nion interpolation.

14

Page 26: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Mechanical Gimbal Lock: Using x, y, z axes to encode orientationgives singular situations.

15

Page 27: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Gimbal Lock — Apollo Systems

Red-painted area = Danger of real Gimbal Lock

16

Page 28: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

2D Rotations

• 2D rotations ↔ complex numbers.

• Why? eiθ (x+ iy) =(

x′ + iy′)

x′ = x cos θ − y sin θ

y′ = x sin θ+ y cos θ

• Complex numbers are a subspace of quater-

nions — so exploit 2D rotations to introduce us

to quaternions and their geometric meaning.

17

Page 29: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Frames in 2D

The tangent and normal to 2D curve move continuously alongthe curve:

θ

T

N

18

Page 30: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Frames in 2D

The tangent and normal to 2D curve move continuously alongthe curve:

θ

NT

19

Page 31: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Frames in 2D

The tangent and normal to 2D curve move continuously alongthe curve:

θ

N T

20

Page 32: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Frame Matrix in 2D

This motion is described at each point (or time) by the matrix:

R2(θ) =[

T N]

=

cos θ − sin θsin θ cos θ

.

21

Page 33: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

The Belt Trick Says:

There is a Problem...at least in 3D

How do you get cos θ to know about 720 degrees?

22

Page 34: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

The Belt Trick Says:

There is a Problem...at least in 3D

How do you get cos θ to know about 720 degrees?

Hmmmmm. cos(θ/2) knows about 720 degrees, right?

23

Page 35: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Half-Angle Transform:

A Fix for the Problem?

Let a = cos(θ/2), b = sin(θ/2),

(i.e., cos θ = a2 − b2, sin θ = 2ab),

and parameterize 2D rotations as:

R2(a, b) =

a2 − b2 −2ab

2ab a2 − b2

.

where orthonormality implies

(a2 + b2)2 = 1

which reduces back to a2 + b2 = 1.24

Page 36: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Frame Evolution in 2D

Examine the time-evolution of a 2D frame (on our way to 3D).

First use θ(t) coordinates:

[

T N]

=

cos θ − sin θsin θ cos θ

.

Differentiate to find frame equations:

˙T(t) = +κN

˙N(t) = −κT ,

where κ(t) = dθ/dt is the curvature.25

Page 37: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Frame Evolution in (a, b):

The basis (T, N) is nasty — Four equations with Three

constraints from orthonormality, but just One true degree of

freedom.

Major Simplification occurs in (a, b) coordinates!!

˙T = 2

aa− bbab+ ba

= 2

a −bb a

ab

26

Page 38: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Frame Evolution in (a, b):

But this formula for ˙T is just κN, where

κN = κ

−2ab

a2 − b2

= κ

a −bb a

−ba

or

κN = κ

a −bb a

0 −11 0

ab

27

Page 39: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

2D Quaternion Frames!

Rearranging terms, both ˙T and ˙N eqns reduce to

ab

=1

2

0 −κ+κ 0

·

ab

This is the square root of frame equations.

28

Page 40: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

2D Quaternions . . .

So one equation in the two “quaternion” variables (a, b) with

the constraint a2+b2 = 1 contains both the frame equations

˙T = +κN

˙N = −κT⇒ this is much better for computer implementation, etc.

29

Page 41: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Rotation as Complex Multiplication

If we let (a+ ib) = exp (i θ/2) we see that

rotation is complex multiplication!

“Quaternion Frames” in 2D are just complex numbers, with

Evolution Eqns = derivative of exp (i θ/2)!

30

Page 42: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Rotation with no matrices!

Due to an extremely deep reason in Clifford Algebras,

a+ ib = eiθ/2

represents rotations “more nicely” than the matrices R(θ).

(a′ + ib′)(a+ ib) = ei(θ′+θ)/2 = A+ iB

where if we want the matrix, we write:

R(θ′)R(θ)=R(θ′ + θ)=

A2 −B2 −2AB

2AB A2 −B2

31

Page 43: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

The Algebra of 2D Rotations

The algebra corresponding to 2D rotations is easy: just com-

plex multiplication!!

(a′, b′) ∗ (a, b) ∼= (a′ + ib′)(a+ ib)

= a′a− b′b+ i(a′b+ ab′)

∼= (a′a− b′b, a′b+ ab′)

= (A, B)

2D Rotations are just complex multiplication, and take youaround the unit circle!

32

Page 44: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternion Frames

In 3D, repeat our trick: take square root of the frame, but now

use quaternions:

• Write down the 3D frame.

• Write as double-valued quadratic form.

• Rewrite frame evolution equations linearly

in the new variables.

33

Page 45: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

The Geometry of 3D Rotations

We begin with a basic fact:

Euler theorem: every 3D frame can be written as a spinningby θ about a fixed axis n, the eigenvector of the rotation ma-trix:

n

θ

34

Page 46: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternion Frames . . .

The Matrix R3(θ, n) giving 3D rotation by θ about axis n is :

c+ (n1)2(1 − c) n1n2(1 − c) − sn3 n3n1(1 − c) + sn2

n1n2(1 − c) + sn3 c+ (n2)2(1 − c) n3n2(1 − c) − sn1

n1n3(1 − c) − sn2 n2n3(1 − c) + sn1 c+ (n3)2(1 − c)

where c = cos θ, s = sin θ, and n · n = 1.

35

Page 47: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Can we find a 720-degree form?

Remember 2D: a2 + b2 = 1then substitute 1 − c = (a2 + b2) − (a2 − b2) = 2b2

to find the remarkable expression for R(θ, n):

a2 − b2 + (n1)2(2b2) 2b2n1n2 − 2abn3 2b2n3n1 + 2abn2

2b2n1n2 + 2abn3 a2 − b2 + (n2)2(2b2) 2b2n2n3 − 2abn1

2b2n3n1 − 2abn2 2b2n2n3 + 2abn1 a2 − b2 + (n3)2(2b2)

36

Page 48: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Rotations and Quadratic Polynomials

Remember (n1)2 + (n2)

2 + (n3)2 = 1 and a2 + b2 = 1;

letting

q0 = a = cos(θ/2) q = bn = n sin(θ/2)

We find a matrix R3(q)

q20 + q21 − q22 − q23 2q1q2 − 2q0q3 2q1q3 + 2q0q22q1q2 + 2q0q3 q20 − q21 + q22 − q23 2q2q3 − 2q0q12q1q3 − 2q0q2 2q2q3 + 2q0q1 q20 − q21 − q22 + q23

37

Page 49: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternions and Rotations . . .

HOW does q = (q0, q) represent rotations?

LOOK at

R3(θ, n)?= R3(q0, q1, q2, q3)

THEN we can verify that choosing

q(θ, n) = (cosθ

2, n sin

θ

2)

makes the R3 equation an IDENTITY .

38

Page 50: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternions and Rotations . . .

WHAT happens if you do TWO rotations?

EXAMINE the action of two rotations

R(q′)R(q) = R(Q)

EXPRESS in quadratic forms in q and LOOK FOR an analogof complex multiplication:

39

Page 51: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternions and Rotations . . .

RESULT: the following multiplication rule

q′ ∗ q = Q yields exactly the correct 3×3 rotation

matrix R(Q):

Q0 =[

q′ ∗ q]

0Q1 =

[

q′ ∗ q]

1Q2 =

[

q′ ∗ q]

2Q3 =

[

q′ ∗ q]

3

=

q′0q0 − q′1q1 − q′2q2 − q′3q3q′0q1 + q′1q0 + q′2q3 − q′3q2q′0q2 + q′2q0 + q′3q1 − q′1q3q′0q3 + q′3q0 + q′1q2 − q′2q1

This is Quaternion Multiplication.

40

Page 52: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Algebra of Quaternions

= 3D Rotations!

2D rotation matrices are represented

by complex multiplication

3D rotation matrices are represented

by quaternion multiplication

41

Page 53: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Algebraic 2D/3D Rotations

Therefore in 3D, the 2D complex multiplication

(a′, b′) ∗ (a, b) = (a′a− b′b, a′b+ ab′)

is replaced by 4D quaternion multiplication:

q′ ∗ q = (q′0q0 − q′1q1 − q′2q2 − q′3q3,

q′0q1 + q′1q0 + q′2q3 − q′3q2,

q′0q2 + q′2q0 + q′3q1 − q′1q3,

q′0q3 + q′3q0 + q′1q2 − q′2q1)

42

Page 54: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Algebra of Quaternions . . .

The equation is easier to remember by dividing it

into a scalar piece q0 and a vector piece ~q:

q′ ∗ q = (q′0q0 − ~q′ ·~q,

q′0~q + q0~q′ + ~q′ ×~q)

43

Page 55: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Now we can SEE quaternions!

Since (q0)2 + q · q = 1 then

q0 =√

1 − q · q

Plot just the 3D vector: q = (qx, qy, qz)

q0 is KNOWN! We can also use any other triple:the fourth component is dependent .

DEMO

44

Page 56: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

We can now make a Quaternion Picture of each of our

favorite tricks

• 360◦ Belt Trick in Quaternion Form. DEMO:

• 720◦ Belt Trick in Quaternion Form.

• Rolling Ball in Quaternion Form. DEMO:

• Gimbal Lock in Quaternion Form.

45

Page 57: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

360◦ Belt Trick in Quaternion Form

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

46

Page 58: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

720◦ Belt Trick in Quaternion Form

-1

-0.5

0

0.5

1

-1-0.5

00.5

1

-1

-0.5

00.5

1-1

-0.5

0

0.5

1

47

Page 59: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Rolling Ball in Quaternion Form

-1-0.500.51

qx

-1-0.500.51

qy

-1

-0.5

0

0.5

1

qz

-1-0.500.51

qx

-1-0.500.51

qy

-1-0.500.51

q0

-1-0.5

0

0.5

1

qx

-1

-0.5

0

0.5

1

qz

-1-0.500.51

q0

-1-0.5

0

0.5

1

qx

q vector-only plot. (q0, qx, qz) plot

48

Page 60: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Gimbal Lock in Quaternion Form

Quaternion Plot of the remaining orientation degreesof freedom of R(θ, x) · R(φ, y) · R(ψ, z) at φ = 0

and φ = π/6

49

Page 61: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Gimbal Lock in Quaternion Form, contd

Choosing φ and plotting the remaining orientationdegrees in the rotation sequence

R(θ, x) · R(φ, y) · R(ψ, z), we see degrees offreedom decrease from TWO to ONE as φ→ π/2

50

Page 62: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternion Interpolations

• Shoemake (Siggraph ’85) proposed using quaternions in-

stead of Euler angles to get smooth frame interpolations

without Gimbal Lock:

BEST CHOICE: Animate objects and cameras using ro-

tations represented on S3 by quaternions

51

Page 63: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Interpolating on Spheres

General quaternion spherical interpolation employs the “SLERP,”

a constant angular velocity transition between two directions,

q1 and q2:

q12(t) = Slerp(q1, q2, t)

= q1sin((1 − t)θ)

sin(θ)+ q2

sin(tθ)

sin(θ)

where cos θ = q1 · q2.

52

Page 64: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Plane Interpolations

In Euclidean space, these three basic cubic splines look likethis:

-1 -0.5 0.5 1

-1

-0.5

0.5

1

1.5

2

-1 -0.5 0.5 1

-1

-0.5

0.5

1

1.5

2

-1 -0.5 0.5 1

-1

-0.5

0.5

1

1.5

2

Bezier Catmull-Rom Uniform B

The differences are in the derivatives: Bezier has to startmatching all over at every fourth point; Catmull-Rom matchesthe first derivative; and B-spline is the cadillac, matching allderivatives but no control points.

53

Page 65: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Spherical Interpolations

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

00.5

1-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

00.5

1

Bezier Catmull-Rom Uniform B

54

Page 66: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternion Interpolations

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

00.5

1-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

00.5

1

Bezier Catmull-Rom Uniform B

55

Page 67: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Exp Form of Quaternion Rotations

In Hamilton’s notation, we can generalize the 2D equation

a+ ib = eiθ/2

Just set

q = (q0, q1, q2, q3)

= q0 + iq1 + jq2 + kq3

= e(I·nθ/2)

with q0 = cos(θ/2) and ~q = n sin(θ/2) and I = (i, j,k),with i2 = j2 = k2 = −1, and i ∗ j = k (cyclic),

56

Page 68: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Key to Quaternion Intuition

Fundamental Intuition: We know

q0 = cos(θ/2), ~q = n sin(θ/2)

We also know that any coordinate frame M can be writtenas M = R(θ, n).

Therefore

~q points exactly along the axis we have to rotate

around to go from identity I to M , and the length of

~q tells us how much to rotate.

57

Page 69: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Summarize Quaternion Properties

• Unit four-vector. Take q = (q0, q1, q2, q3) = (q0, ~q) to

obey constraint q · q = 1.

• Multiplication rule. The quaternion product q and p is

q ∗ p = (q0p0 − ~q · ~p, q0~p + p0~q + ~q × ~p),

or, alternatively,

[q ∗ p]0[q ∗ p]1[q ∗ p]2[q ∗ p]3

=

q0p0 − q1p1 − q2p2 − q3p3q0p1 + q1p0 + q2p3 − q3p2q0p2 + q2p0 + q3p1 − q1p3q0p3 + q3p0 + q1p2 − q2p1

58

Page 70: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternion Summary . . .

• Rotation Correspondence. The unit quaternions q and

−q correspond to a single 3D rotation R3:

q20 + q21 − q22 − q23 2q1q2 − 2q0q3 2q1q3 + 2q0q22q1q2 + 2q0q3 q20 − q21 + q22 − q23 2q2q3 − 2q0q12q1q3 − 2q0q2 2q2q3 + 2q0q1 q20 − q21 − q22 + q23

If

q = (cosθ

2, n sin

θ

2) ,

with n a unit 3-vector, n · n = 1. Then R(θ, n) is usual 3Drotation by θ in the plane ⊥ to n.

59

Page 71: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

SUMMARY

• Quaternions represent 3D frames

• Quaternion multiplication represents 3D rotation

• Quaternions are points on a hypersphere

• Quaternions paths can be visualized with 3D display

• Belt Trick, Rolling Ball, and Gimbal Lock can be un-

derstood as Quaternion Paths.

60

Page 72: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Visualizing Quaternions

Andrew J. Hanson

Computer Science Department

Indiana University

Siggraph 2007 Tutorial

1

OUTLINE

I: (50 min) Twisting Belts, Rolling Balls,

and Locking Gimbals:

Explaining Rotation Sequences with Quaternions

II: (50 min) Quaternion Fields:

Curves, Surfaces, and Volumes

2

Part I

Twisting Belts, Rolling Balls, andLocking Gimbals

Explaining Rotation Sequences with Quaternions

3

Where Did Quaternions Come From?

. . . from the discovery of Complex Numbers:

• z = x+ iy Complex numbers = realization

that z2 + 1 = 0 cannot be solved unless you

have an “imaginary” number with i2 = −1.

• Euler’s formula: eiθ = cos θ+ i sin θ

allows you to do most of 2D geometry.

4

Hamilton

The first to ask “If you can do 2D geometry with complex numbers, howmight you do 3D geometry?” was William Rowan Hamilton, circa 1840.

Sir William Rowan Hamilton4 August 1805 — 2 September 1865

5

Hamilton’s epiphany: 16 October 1843

“An electric circuit seemed to close; and a spark flashed

forth . . . Nor could I resist the impulse – unphilosophi-

cal as it may have been – to cut with a knife on a stone

of Brougham Bridge, as we passed it, the fundamen-

tal formula with the symbols, i, j, k; namely,

i2 = j2 = k2 = ijk = −1

which contains the Solution of the Problem...”

6

Page 73: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

...at the site of Hamilton’s carving

The plaque on Broome Bridge in Dublin, Ireland, commem-orating the legendary location where Hamilton conceived ofthe idea of quaternions. (Hamilton apparently misspelled itas “Brougham Bridge” in his letter.)

7

The Belt TrickQuaternion Geometry in our daily lives

• Two people hold ends of a belt.

• Twist the belt either 360 degrees or 720 de-

grees.

• Rule: Move belt ends any way you like but do

not change orientation of either end.

• Try to straighten out the belt.

8

360 Degree Belt

360 twist: stays twisted, can change DIRECTION!9

720 Degree Belt

720 twist: CAN FLATTEN OUT WHOLE BELT!10

The Beltless TrickQuaternion Geometry is right in your hand!

• Hold a coffee cup (empty is a good idea) in the

palm of your hand.

• Keeping the cup vertical, user your hand to twist

the handle, first by 360 degrees (painful).

• Now CONTINUE another 360 degrees, for a to-

tal of 720 degrees.

• Your arm is once again STRAIGHT!

11

Rolling Ball Puzzle

1. Put a ball on a flat table.2. Place hand flat on top of the ball3. Make circular rubbing motion, as though polish-

ing the tabletop.4. Watch a point on the equator of the ball.5. small clockwise circles →

equator goes counterclockwise6. small counterclockwise circles →

equator goes clockwise

12

Page 74: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Rolling Ball ScenarioPoint of Contact

y axis rotation

x axis rotation

motion

in plane

13

Gimbal Lock

Gimbal Lock occurs when a mechanical or com-

puter system experiences an anomaly due to an

(x, y, z)-based orientation control sequence.

• Mechanical systems cannot avoid all possible gim-

bal lock situations .

• Computer orientation interpolation systems canavoid gimbal-lock-related glitches by using quater-nion interpolation.

14

Mechanical Gimbal Lock: Using x, y, z axes to encode orientationgives singular situations.

15

Gimbal Lock — Apollo Systems

Red-painted area = Danger of real Gimbal Lock

16

2D Rotations

• 2D rotations ↔ complex numbers.

• Why? eiθ (x+ iy) =(

x′ + iy′)

x′ = x cos θ − y sin θ

y′ = x sin θ+ y cos θ

• Complex numbers are a subspace of quater-

nions — so exploit 2D rotations to introduce us

to quaternions and their geometric meaning.

17

Frames in 2D

The tangent and normal to 2D curve move continuously alongthe curve:

θ

T

N

18

Page 75: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Frames in 2D

The tangent and normal to 2D curve move continuously alongthe curve:

θ

NT

19

Frames in 2D

The tangent and normal to 2D curve move continuously alongthe curve:

θ

N T

20

Frame Matrix in 2D

This motion is described at each point (or time) by the matrix:

R2(θ) =[

T N]

=

cos θ − sin θsin θ cos θ

.

21

The Belt Trick Says:

There is a Problem...at least in 3D

How do you get cos θ to know about 720 degrees?

22

The Belt Trick Says:

There is a Problem...at least in 3D

How do you get cos θ to know about 720 degrees?

Hmmmmm. cos(θ/2) knows about 720 degrees, right?

23

Half-Angle Transform:

A Fix for the Problem?

Let a = cos(θ/2), b = sin(θ/2),

(i.e., cos θ = a2 − b2, sin θ = 2ab),

and parameterize 2D rotations as:

R2(a, b) =

a2 − b2 −2ab

2ab a2 − b2

.

where orthonormality implies

(a2 + b2)2 = 1

which reduces back to a2 + b2 = 1.24

Page 76: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Frame Evolution in 2D

Examine the time-evolution of a 2D frame (on our way to 3D).

First use θ(t) coordinates:

[

T N]

=

cos θ − sin θsin θ cos θ

.

Differentiate to find frame equations:

˙T(t) = +κN

˙N(t) = −κT ,

where κ(t) = dθ/dt is the curvature.25

Frame Evolution in (a, b):

The basis (T, N) is nasty — Four equations with Three

constraints from orthonormality, but just One true degree of

freedom.

Major Simplification occurs in (a, b) coordinates!!

˙T = 2

aa− bbab+ ba

= 2

a −bb a

ab

26

Frame Evolution in (a, b):

But this formula for ˙T is just κN, where

κN = κ

−2ab

a2 − b2

= κ

a −bb a

−ba

or

κN = κ

a −bb a

0 −11 0

ab

27

2D Quaternion Frames!

Rearranging terms, both ˙T and ˙N eqns reduce to

ab

=1

2

0 −κ+κ 0

·

ab

This is the square root of frame equations.

28

2D Quaternions . . .

So one equation in the two “quaternion” variables (a, b) with

the constraint a2+b2 = 1 contains both the frame equations

˙T = +κN

˙N = −κT⇒ this is much better for computer implementation, etc.

29

Rotation as Complex Multiplication

If we let (a+ ib) = exp (i θ/2) we see that

rotation is complex multiplication!

“Quaternion Frames” in 2D are just complex numbers, with

Evolution Eqns = derivative of exp (i θ/2)!

30

Page 77: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Rotation with no matrices!

Due to an extremely deep reason in Clifford Algebras,

a+ ib = eiθ/2

represents rotations “more nicely” than the matrices R(θ).

(a′ + ib′)(a+ ib) = ei(θ′+θ)/2 = A+ iB

where if we want the matrix, we write:

R(θ′)R(θ)=R(θ′ + θ)=

A2 −B2 −2AB

2AB A2 −B2

31

The Algebra of 2D Rotations

The algebra corresponding to 2D rotations is easy: just com-

plex multiplication!!

(a′, b′) ∗ (a, b) ∼= (a′ + ib′)(a+ ib)

= a′a− b′b+ i(a′b+ ab′)

∼= (a′a− b′b, a′b+ ab′)

= (A, B)

2D Rotations are just complex multiplication, and take youaround the unit circle!

32

Quaternion Frames

In 3D, repeat our trick: take square root of the frame, but now

use quaternions:

• Write down the 3D frame.

• Write as double-valued quadratic form.

• Rewrite frame evolution equations linearly

in the new variables.

33

The Geometry of 3D Rotations

We begin with a basic fact:

Euler theorem: every 3D frame can be written as a spinningby θ about a fixed axis n, the eigenvector of the rotation ma-trix:

n

θ

34

Quaternion Frames . . .

The Matrix R3(θ, n) giving 3D rotation by θ about axis n is :

c+ (n1)2(1 − c) n1n2(1 − c) − sn3 n3n1(1 − c) + sn2

n1n2(1 − c) + sn3 c+ (n2)2(1 − c) n3n2(1 − c) − sn1

n1n3(1 − c) − sn2 n2n3(1 − c) + sn1 c+ (n3)2(1 − c)

where c = cos θ, s = sin θ, and n · n = 1.

35

Can we find a 720-degree form?

Remember 2D: a2 + b2 = 1then substitute 1 − c = (a2 + b2) − (a2 − b2) = 2b2

to find the remarkable expression for R(θ, n):

a2 − b2 + (n1)2(2b2) 2b2n1n2 − 2abn3 2b2n3n1 + 2abn2

2b2n1n2 + 2abn3 a2 − b2 + (n2)2(2b2) 2b2n2n3 − 2abn1

2b2n3n1 − 2abn2 2b2n2n3 + 2abn1 a2 − b2 + (n3)2(2b2)

36

Page 78: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Rotations and Quadratic Polynomials

Remember (n1)2 + (n2)

2 + (n3)2 = 1 and a2 + b2 = 1;

letting

q0 = a = cos(θ/2) q = bn = n sin(θ/2)

We find a matrix R3(q)

q20 + q21 − q22 − q23 2q1q2 − 2q0q3 2q1q3 + 2q0q22q1q2 + 2q0q3 q20 − q21 + q22 − q23 2q2q3 − 2q0q12q1q3 − 2q0q2 2q2q3 + 2q0q1 q20 − q21 − q22 + q23

37

Quaternions and Rotations . . .

HOW does q = (q0, q) represent rotations?

LOOK at

R3(θ, n)?= R3(q0, q1, q2, q3)

THEN we can verify that choosing

q(θ, n) = (cosθ

2, n sin

θ

2)

makes the R3 equation an IDENTITY .

38

Quaternions and Rotations . . .

WHAT happens if you do TWO rotations?

EXAMINE the action of two rotations

R(q′)R(q) = R(Q)

EXPRESS in quadratic forms in q and LOOK FOR an analogof complex multiplication:

39

Quaternions and Rotations . . .

RESULT: the following multiplication rule

q′ ∗ q = Q yields exactly the correct 3×3 rotation

matrix R(Q):

Q0 =[

q′ ∗ q]

0Q1 =

[

q′ ∗ q]

1Q2 =

[

q′ ∗ q]

2Q3 =

[

q′ ∗ q]

3

=

q′0q0 − q′1q1 − q′2q2 − q′3q3q′0q1 + q′1q0 + q′2q3 − q′3q2q′0q2 + q′2q0 + q′3q1 − q′1q3q′0q3 + q′3q0 + q′1q2 − q′2q1

This is Quaternion Multiplication.

40

Algebra of Quaternions

= 3D Rotations!

2D rotation matrices are represented

by complex multiplication

3D rotation matrices are represented

by quaternion multiplication

41

Algebraic 2D/3D Rotations

Therefore in 3D, the 2D complex multiplication

(a′, b′) ∗ (a, b) = (a′a− b′b, a′b+ ab′)

is replaced by 4D quaternion multiplication:

q′ ∗ q = (q′0q0 − q′1q1 − q′2q2 − q′3q3,

q′0q1 + q′1q0 + q′2q3 − q′3q2,

q′0q2 + q′2q0 + q′3q1 − q′1q3,

q′0q3 + q′3q0 + q′1q2 − q′2q1)

42

Page 79: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Algebra of Quaternions . . .

The equation is easier to remember by dividing it

into a scalar piece q0 and a vector piece ~q:

q′ ∗ q = (q′0q0 − ~q′ ·~q,

q′0~q + q0~q′ + ~q′ ×~q)

43

Now we can SEE quaternions!

Since (q0)2 + q · q = 1 then

q0 =√

1 − q · q

Plot just the 3D vector: q = (qx, qy, qz)

q0 is KNOWN! We can also use any other triple:the fourth component is dependent .

DEMO

44

We can now make a Quaternion Picture of each of our

favorite tricks

• 360◦ Belt Trick in Quaternion Form. DEMO:

• 720◦ Belt Trick in Quaternion Form.

• Rolling Ball in Quaternion Form. DEMO:

• Gimbal Lock in Quaternion Form.

45

360◦ Belt Trick in Quaternion Form

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

46

720◦ Belt Trick in Quaternion Form

-1

-0.5

0

0.5

1

-1-0.5

00.5

1

-1

-0.5

00.5

1-1

-0.5

0

0.5

1

47

Rolling Ball in Quaternion Form

-1-0.500.51

qx

-1-0.500.51

qy

-1

-0.5

0

0.5

1

qz

-1-0.500.51

qx

-1-0.500.51

qy

-1-0.500.51

q0

-1-0.5

0

0.5

1

qx

-1

-0.5

0

0.5

1

qz

-1-0.500.51

q0

-1-0.5

0

0.5

1

qx

q vector-only plot. (q0, qx, qz) plot

48

Page 80: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Gimbal Lock in Quaternion Form

Quaternion Plot of the remaining orientation degreesof freedom of R(θ, x) · R(φ, y) · R(ψ, z) at φ = 0

and φ = π/6

49

Gimbal Lock in Quaternion Form, contd

Choosing φ and plotting the remaining orientationdegrees in the rotation sequence

R(θ, x) · R(φ, y) · R(ψ, z), we see degrees offreedom decrease from TWO to ONE as φ→ π/2

50

Quaternion Interpolations

• Shoemake (Siggraph ’85) proposed using quaternions in-

stead of Euler angles to get smooth frame interpolations

without Gimbal Lock:

BEST CHOICE: Animate objects and cameras using ro-

tations represented on S3 by quaternions

51

Interpolating on Spheres

General quaternion spherical interpolation employs the “SLERP,”

a constant angular velocity transition between two directions,

q1 and q2:

q12(t) = Slerp(q1, q2, t)

= q1sin((1 − t)θ)

sin(θ)+ q2

sin(tθ)

sin(θ)

where cos θ = q1 · q2.

52

Plane Interpolations

In Euclidean space, these three basic cubic splines look likethis:

-1 -0.5 0.5 1

-1

-0.5

0.5

1

1.5

2

-1 -0.5 0.5 1

-1

-0.5

0.5

1

1.5

2

-1 -0.5 0.5 1

-1

-0.5

0.5

1

1.5

2

Bezier Catmull-Rom Uniform B

The differences are in the derivatives: Bezier has to startmatching all over at every fourth point; Catmull-Rom matchesthe first derivative; and B-spline is the cadillac, matching allderivatives but no control points.

53

Spherical Interpolations

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

00.5

1-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

00.5

1

Bezier Catmull-Rom Uniform B

54

Page 81: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternion Interpolations

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

00.5

1-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

00.5

1

Bezier Catmull-Rom Uniform B

55

Exp Form of Quaternion Rotations

In Hamilton’s notation, we can generalize the 2D equation

a+ ib = eiθ/2

Just set

q = (q0, q1, q2, q3)

= q0 + iq1 + jq2 + kq3

= e(I·nθ/2)

with q0 = cos(θ/2) and ~q = n sin(θ/2) and I = (i, j,k),with i2 = j2 = k2 = −1, and i ∗ j = k (cyclic),

56

Key to Quaternion Intuition

Fundamental Intuition: We know

q0 = cos(θ/2), ~q = n sin(θ/2)

We also know that any coordinate frame M can be writtenas M = R(θ, n).

Therefore

~q points exactly along the axis we have to rotate

around to go from identity I to M , and the length of

~q tells us how much to rotate.

57

Summarize Quaternion Properties

• Unit four-vector. Take q = (q0, q1, q2, q3) = (q0, ~q) to

obey constraint q · q = 1.

• Multiplication rule. The quaternion product q and p is

q ∗ p = (q0p0 − ~q · ~p, q0~p + p0~q + ~q × ~p),

or, alternatively,

[q ∗ p]0[q ∗ p]1[q ∗ p]2[q ∗ p]3

=

q0p0 − q1p1 − q2p2 − q3p3q0p1 + q1p0 + q2p3 − q3p2q0p2 + q2p0 + q3p1 − q1p3q0p3 + q3p0 + q1p2 − q2p1

58

Quaternion Summary . . .

• Rotation Correspondence. The unit quaternions q and

−q correspond to a single 3D rotation R3:

q20 + q21 − q22 − q23 2q1q2 − 2q0q3 2q1q3 + 2q0q22q1q2 + 2q0q3 q20 − q21 + q22 − q23 2q2q3 − 2q0q12q1q3 − 2q0q2 2q2q3 + 2q0q1 q20 − q21 − q22 + q23

If

q = (cosθ

2, n sin

θ

2) ,

with n a unit 3-vector, n · n = 1. Then R(θ, n) is usual 3Drotation by θ in the plane ⊥ to n.

59

SUMMARY

• Quaternions represent 3D frames

• Quaternion multiplication represents 3D rotation

• Quaternions are points on a hypersphere

• Quaternions paths can be visualized with 3D display

• Belt Trick, Rolling Ball, and Gimbal Lock can be un-

derstood as Quaternion Paths.

60

Page 82: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Visualizing Quaternions

Part II

Quaternion Fields

Curves, Surfaces, and Volumes

1

Page 83: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

OUTLINE� Quaternion Curves: generalize the Frenet Frame, opti-

mize in quaternion space

� Quaternion Surfaces: generalize Gauss map, optimize

in quaternion space

� Quaternion Volumes: visualize degrees of freedom of a

joint

2

Page 84: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

What are Frames used For?� Move objects and object parts in an animated scene.

� Move the camera generating the rendered viewpoint of

the scene.

� Attach tubes and textures to thickened lines, oriented tex-

tures to surfaces.

� Compare shapes of similar curves.

� Collect orientation data of moving object (e.g., a joint)

3

Page 85: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Motivating Problem: Framing Curves

�������

The (3,5) torus knot.

� Line drawing � useless.

� Tubing based on parallel transport, not periodic.

� Closeup of the non-periodic mismatch.

4

Page 86: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Motivating Problems: Curves

������

�������

Closeup of the non-periodic mismatch.Can’t apply texture.

5

Page 87: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Motivating Problems: Surfaces

A smooth 3D surface patch: two ways to get bottom frame.

No unique orthonormal frame is derivable from the parame-terization.

6

Page 88: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

3D Curves: Frenet and PT Frames

Now give more details of 3D frames: Classic Moving Frame:� ��

�� �� � �� � �

� ���

� � ���

� � � �� � � � � � � � � � �� � � � � � � � �� ��

�� ��

�� �� � �� � �

� ���

Serret-Frenet frame: � � � � , � � � � � is the curvature,

and � � � � � is the classical torsion. LOCAL.

Parallel Transport frame (Bishop): � � � to get minimal turn-

ing. NON-LOCAL = an INTEGRAL.7

Page 89: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

3D curve frames, contd

Frenet frame is locally defined, e.g., by

� � � � �� �� � �

� � �� �� � � �

but has problems on the “roof.”

N

N

B

T

T

B

B

NB

???

NT

T

8

Page 90: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

3D curve frames, contd

Bishop’s Parallel Transport frame is integrated over wholecurve, non-local, but no problems on “roof:”

N1

N1

N1N1

N1

N2

N2

N2

N2

N2

T

T

T

T

T

9

Page 91: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

3D curve frames, contd

Geodesic Reference Frame is the frame found by tilting NorthPole of “canonical frame” along a great circle until it points indesired direction (tangent for curves, normal for surfaces).

MAIN VALUE: A foolproof reference frame for sliding rings.

10

Page 92: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Frames in 3D, contd

Observations:

Tubing and Generalized Cones. Any of these frames can be usedto solve the tubing problem.

Minimality. The PT frame appears to be unique frame with minimumtotal rotation. Examine later in quaternion space.

Distributed Twist. A conventional compromise distributes a user-desired boundary twist uniformly across vertex frames: This is bestdone using uniform Quaternion distances between uniformly spa-tially sampled frames.

11

Page 93: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Sample Curve Tubings and their Frames

Frenet Geodesic Reference Parallel Transport

Easily see PT has least “Twist,” but lacksperiodicity.

12

Page 94: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

3D Frames to Quaternion Frames Quaternion Correspondence. The unit quaternions

! and � ! correspond to a single 3D rotation " # ! :

� ��

$&% ')( $&% *,+ $&%% + $&% - � $ * $% + � $ ' $ - � $ * $ -( � $ ' $%� $ * $% ( � $ ' $ - $.% ' + $.% *( $.%% + $% - � $% $ - + � $ ' $ *� $ * $ - + � $ ' $% � $% $ -( � $ ' $ * $/% ' + $/% */+ $/%% ( $/% -� �

Rotation Correspondence.

! � �01 243 �65 78 29: 3 � , with 78 a unit 3-vector, 78<; 78 � = .

" �> 5 78 is usual 3D rotation by> in the plane perpendic-ular to 78 .

Extract quaternion: Either directly from sequence ofquaternion multiplications, or indirectly from " # ! .

13

Page 95: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternion Frame Evolution

Just as in 2D, let columns of " # ! be a 9-part frame: � 5 � 5 � .

Derivatives of the ? -th column " @ in quaternion coordinates

have the form:

A" @� B @; C A! � D

e.g. � � � ���

! E ! � � ! � � ! #

! # ! � ! � ! E� ! � ! # � ! E ! �� ��

where ? � =5 B 5GF and rows form mutually orthonormal ba-sis.

14

Page 96: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternion Frame Evolution . . .

When we simplify by eliminating @ . . .

we find the square root of the 3D frame eqns!

Tait (1890) derived the quaternion equation that makes all 9

3D frame equations reduce to: A! � = H B !JI � 5 K or:

� ������

A! EA! �A! �A! #� �����

�� =

B� �����

�� � � � � � � �� � � � � � � �

� � � � � � � �

� � � � � �� �����

�;

� ������

! E! �

! �! #

� ������

15

Page 97: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternion Frames . . .

Properties of Tait’s quaternion frame equations:

� Antisymmetry L ! � ; A! � � � as required to keep

constant unit radius on 3-sphere.

� Nine equations and six constraints become four equa-

tions and one constraint , keeping quaternion on the 3-

sphere. L Good for computer implementation.

� MATHEMATICA code implementing this differential equa-

tion is provided.

16

Page 98: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternion Frames . . .

� Analogous treatment (given in Hanson Tech Note in Course

Notes) applies also to the Weingarten equations, allowing

a direct quaternion treatment of the classical differential

geometry of surfaces as well.

17

Page 99: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Example of a Quaternion Frame Curve

Left Curve = torus knot tubed with Frenet frame; Right Curveis projection from 4D of (twice around) quaternion Frenetframes:

-1

-0.5

0

0.5

1-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

see Notes: Hanson and Ma, “Quaternion Frame Approach to StreamlineVisualization,” IEEE Trans. on Visualiz. and Comp. Graphics, 1, No. 2,pp. 164–174 (June, 1995).

18

Page 100: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Minimizing Quaternion Length Solves PeriodicTube

Quaternion space optimization of the non-periodic paralleltransport frame of the (3,5) torus knot.

-1 -0.5 0 0.5 1

-1-0.5

00.5

1

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1 -0.5 0 0.5 1

-1-0.5

00.5

1

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

see Notes: “Constrained Optimal Framings of Curves and Surfaces usingQuaternion Gauss Maps,” Proceedings of Visualization ’98, pp. 375–382(1998).

19

Page 101: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Minimizing Quaternion Length Works

Result of Quaternion space optimization of the (3,5) torusknot frame.

������

�������

20

Page 102: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Return to Frames on Surface Patch

Remember: no unique way to disambiguate bot-tom frame.

21

Page 103: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Can also Optimize Quaternion Frames onPatch:

0

0.2

0.4

0

0.2

0.4

-0.2

-0.1

0

0.1

0.2

0

0.2

0.4

0

0.2

0.4

0

0.2

0.4

0

0.2

0.4

-0.2

-0.1

0

0.1

0.2

0

0.2

0.4

0

0.2

0.4-0.2 0

0.20.4

-0.25

00.25

0.5

-0.5

0

0.5

1-0.25

00.25

0.5

0

0.2

0.4

0

0.2

0.4

-0.2

-0.1

0

0.1

0.2

0

0.2

0.4

0

0.2

0.4

(a) (b) (c) (d)

Quaternion frames for (a) Geodesic Ref. (b) One edge Parallel Transport.(c) Random. (d) Minimal area result.

22

Page 104: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

3D Frames for Patch

(a) (b) (c) (d)Quaternion frames for (a) Geodesic Ref. (b) One edge Par-allel Transport. (c) Random. (d) Minimal area result.

23

Page 105: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternion Volumes

Last possible orientation field = Volumes:

M Collections of oriented objects in a volume.

M 3 degree-of-freedom control monitoring

M 3 degree-of-freedom biological and robotic joints

all map to Quaternion Volumes

24

Page 106: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternion Volumes

QuaternionPoints

Lattice with Frames

25

Page 107: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Joystick as Quaternion volume

SPIN

TILT

Motion of joystick maps to quaternion volume.

26

Page 108: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Joystick as quaternion volume

“Solid cone” describes the joystick access spaceas a quaternion volume

27

Page 109: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternion volumes: Shoulder data

Quaternion shoulder joint data beforecorrection for doubling.

28

Page 110: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternion volumes: Shoulder data

Shoulder data with neighbors forced to be insame hemisphere of quaternion space as

their predecessors.29

Page 111: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternion volumes: Shoulder data

(a) (b)

(a) A dense sample of shoulder orientation data inquaternion space.(b) Implicit surface model fitted to the data. (Herdaet al.)

30

Page 112: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Clifford Algebras� All Rotations in any dimension are represented

by two reflections using Clifford Algebra:

N and � define the perpendicular directions to two re-

flection planes, N ; N � � ; � � = .

� Create Rotation Matrix O and solve for the Quater-

nion, and you amazingly get THIS:

! N 5 � � N ; � 5 N � � 31

Page 113: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Clifford Algebra Quaternion Form . . .

Why is this a quaternion form?!; ! � N ; � � N � � ; N � �

� N ; N � ; �

P =

If Quaternions are like the Square Roots of Ro-tations, then Clifford Algebras are like the SquareRoots of Quaternions!

32

Page 114: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

SUMMARY� Quaternions nicely represent frame sequences.

� Curve frames L quaternion curves.

� Surface patch frames L quaternion surface patches.

(Tubes, Proteins, . . . )

� Minimizing quaternion length or area finds parallel

transport “minimal turning” set of frames.

� Volume sampled frames L quaternion volumes.

Use Quaternions for Global Picture of anyorientation sequence or collection!

33

Page 115: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Visualizing Quaternions

Part II

Quaternion Fields

Curves, Surfaces, and Volumes

1

OUTLINE

Quaternion Curves: generalize the Frenet Frame, opti-

mize in quaternion space

Quaternion Surfaces: generalize Gauss map, optimize

in quaternion space

Quaternion Volumes: visualize degrees of freedom of a

joint

2

What are Frames used For?

Move objects and object parts in an animated scene.

Move the camera generating the rendered viewpoint of

the scene.

Attach tubes and textures to thickened lines, oriented tex-

tures to surfaces.

Compare shapes of similar curves.

Collect orientation data of moving object (e.g., a joint)

3

Motivating Problem: Framing Curves

The (3,5) torus knot.Line drawing useless.

Tubing based on parallel transport, not periodic.

Closeup of the non-periodic mismatch.

4

Motivating Problems: Curves

Closeup of the non-periodic mismatch.Can’t apply texture.

5

Motivating Problems: Surfaces

A smooth 3D surface patch: two ways to get bottom frame.

No unique orthonormal frame is derivable from the parame-terization.

6

Page 116: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

3D Curves: Frenet and PT Frames

Now give more details of 3D frames: Classic Moving Frame:

Serret-Frenet frame: , is the curvature,

and is the classical torsion. LOCAL.

Parallel Transport frame (Bishop): to get minimal turn-

ing. NON-LOCAL = an INTEGRAL.7

3D curve frames, contd

Frenet frame is locally defined, e.g., by

but has problems on the “roof.”

N

N

B

T

T

B

B

NB

???

NT

T

8

3D curve frames, contd

Bishop’s Parallel Transport frame is integrated over wholecurve, non-local, but no problems on “roof:”

N1

N1

N1N1

N1

N2

N2

N2

N2

N2

T

T

T

T

T

9

3D curve frames, contd

Geodesic Reference Frame is the frame found by tilting NorthPole of “canonical frame” along a great circle until it points indesired direction (tangent for curves, normal for surfaces).

MAIN VALUE: A foolproof reference frame for sliding rings.

10

Frames in 3D, contd

Observations:

Tubing and Generalized Cones. Any of these frames can be usedto solve the tubing problem.

Minimality. The PT frame appears to be unique frame with minimumtotal rotation. Examine later in quaternion space.

Distributed Twist. A conventional compromise distributes a user-desired boundary twist uniformly across vertex frames: This is bestdone using uniform Quaternion distances between uniformly spa-tially sampled frames.

11

Sample Curve Tubings and their Frames

Frenet Geodesic Reference Parallel Transport

Easily see PT has least “Twist,” but lacksperiodicity.

12

Page 117: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

3D Frames to Quaternion Frames

Quaternion Correspondence. The unit quaternionsand correspond to a single 3D rotation :

Rotation Correspondence., with a unit 3-vector, .

is usual 3D rotation by in the plane perpendic-ular to .

Extract quaternion: Either directly from sequence ofquaternion multiplications, or indirectly from .

13

Quaternion Frame Evolution

Just as in 2D, let columns of be a 9-part frame: .

Derivatives of the -th column in quaternion coordinates

have the form:

e.g.

where and rows form mutually orthonormal ba-sis.

14

Quaternion Frame Evolution . . .

When we simplify by eliminating . . .

we find the square root of the 3D frame eqns!

Tait (1890) derived the quaternion equation that makes all 9

3D frame equations reduce to: or:

15

Quaternion Frames . . .

Properties of Tait’s quaternion frame equations:

Antisymmetry as required to keep

constant unit radius on 3-sphere.

Nine equations and six constraints become four equa-

tions and one constraint , keeping quaternion on the 3-

sphere. Good for computer implementation.

MATHEMATICA code implementing this differential equa-

tion is provided.

16

Quaternion Frames . . .

Analogous treatment (given in Hanson Tech Note in Course

Notes) applies also to the Weingarten equations, allowing

a direct quaternion treatment of the classical differential

geometry of surfaces as well.

17

Example of a Quaternion Frame CurveLeft Curve = torus knot tubed with Frenet frame; Right Curveis projection from 4D of (twice around) quaternion Frenetframes:

-1-0.5

0

0.5

1-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1-0.5

0

0.5

1

see Notes: Hanson and Ma, “Quaternion Frame Approach to StreamlineVisualization,” IEEE Trans. on Visualiz. and Comp. Graphics, 1, No. 2,pp. 164–174 (June, 1995).

18

Page 118: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Minimizing Quaternion Length Solves PeriodicTube

Quaternion space optimization of the non-periodic paralleltransport frame of the (3,5) torus knot.

-1 -0.5 0 0.5 1

-1-0.5

00.5

1

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

-1 -0.5 0 0.5 1

-1-0.5

00.5

1

-1

-0.5

0

0.5

1

-1

-0.5

0

0.5

1

see Notes: “Constrained Optimal Framings of Curves and Surfaces usingQuaternion Gauss Maps,” Proceedings of Visualization ’98, pp. 375–382(1998).

19

Minimizing Quaternion Length Works

Result of Quaternion space optimization of the (3,5) torusknot frame.

20

Return to Frames on Surface Patch

Remember: no unique way to disambiguate bot-tom frame.

21

Can also Optimize Quaternion Frames onPatch:

0

0.2

0.4

0

0.2

0.4

-0.2

-0.1

0

0.1

0.2

0

0.2

0.4

0

0.2

0.4

0

0.2

0.4

0

0.2

0.4

-0.2

-0.1

0

0.1

0.2

0

0.2

0.4

0

0.2

0.4-0.2 0 0.2 0.4

-0.2500.25

0.5

-0.5

0

0.5

1-0.25

00.25

0.5

0

0.2

0.4

0

0.2

0.4

-0.2

-0.1

0

0.1

0.2

0

0.2

0.4

0

0.2

0.4

(a) (b) (c) (d)

Quaternion frames for (a) Geodesic Ref. (b) One edge Parallel Transport.(c) Random. (d) Minimal area result.

22

3D Frames for Patch

(a) (b) (c) (d)Quaternion frames for (a) Geodesic Ref. (b) One edge Par-allel Transport. (c) Random. (d) Minimal area result.

23

Quaternion Volumes

Last possible orientation field = Volumes:

Collections of oriented objects in a volume.

3 degree-of-freedom control monitoring

3 degree-of-freedom biological and robotic joints

all map to Quaternion Volumes

24

Page 119: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Quaternion Volumes

QuaternionPoints

Lattice with Frames

25

Joystick as Quaternion volume

SPIN

TILT

Motion of joystick maps to quaternion volume.

26

Joystick as quaternion volume

“Solid cone” describes the joystick access spaceas a quaternion volume

27

Quaternion volumes: Shoulder data

Quaternion shoulder joint data beforecorrection for doubling.

28

Quaternion volumes: Shoulder data

Shoulder data with neighbors forced to be insame hemisphere of quaternion space as

their predecessors.29

Quaternion volumes: Shoulder data

(a) (b)

(a) A dense sample of shoulder orientation data inquaternion space.(b) Implicit surface model fitted to the data. (Herdaet al.)

30

Page 120: Visualizing Quaternions - Interdisciplinary · interfaces for exploration and manipulation of mathematical objects in dimensions three and four, the de-piction of Calabi-Yau spaces,

Clifford Algebras

All Rotations in any dimension are representedby two reflections using Clifford Algebra:

and define the perpendicular directions to two re-

flection planes, .

Create Rotation Matrix and solve for the Quater-

nion, and you amazingly get THIS:

31

Clifford Algebra Quaternion Form . . .

Why is this a quaternion form?

If Quaternions are like the Square Roots of Ro-tations, then Clifford Algebras are like the SquareRoots of Quaternions!

32

SUMMARY

Quaternions nicely represent frame sequences.Curve frames quaternion curves.

Surface patch frames quaternion surface patches.(Tubes, Proteins, . . . )

Minimizing quaternion length or area finds paralleltransport “minimal turning” set of frames.

Volume sampled frames quaternion volumes.

Use Quaternions for Global Picture of anyorientation sequence or collection!

33