Geometric Algebra: An Algebraic System for Computer Games and Animation John Vince Geometric Algebra: An Algebraic System for Computer Games and Animation Prof.JohnVince,MTech,PhD,DSc,CEng,FBCS www.johnvince.co.uk ISBN978-1-84882-378-5 e-ISBN978-1-84882-379-2 DOI10.1007/978-1-84882-379-2 SpringerDordrechtHeidelbergLondonNewYork BritishLibraryCataloguinginPublicationData AcataloguerecordforthisbookisavailablefromtheBritishLibrary LibraryofCongressControlNumber:2009926270 (cid:2)c Springer-VerlagLondonLimited2009 Apart from any fair dealing for the purposes of research or private study, or criticism or review, as permittedundertheCopyright,DesignsandPatentsAct1988,thispublicationmayonlybereproduced, storedortransmitted,inanyformorbyanymeans,withthepriorpermissioninwritingofthepublishers, or in the case of reprographic reproduction in accordance with the terms of licenses issued by the CopyrightLicensingAgency.Enquiriesconcerningreproductionoutsidethosetermsshouldbesentto thepublishers. Theuseofregisterednames,trademarks,etc.,inthispublicationdoesnotimply,evenintheabsenceofa specificstatement,thatsuchnamesareexemptfromtherelevantlawsandregulationsandthereforefree forgeneraluse. Thepublishermakesnorepresentation,expressorimplied,withregardtotheaccuracyoftheinformation containedinthisbookandcannotacceptanylegalresponsibilityorliabilityforanyerrorsoromissions thatmaybemade. Coverdesign BoekhorstDesignBV Printedonacid-freepaper SpringerispartofSpringerScience+BusinessMedia(www.springer.com) Thisbookisaffectionatelydedicatedtomyfamily:Annie,Samantha,Anthony,Genny,Peter,Megan, Mia,LucieandmydogMonty. Preface Inmyfirstbookongeometricalgebrain2007theprefacedescribedhowIhadbeencompletely surprisedbytheexistenceofgeometricalgebra,especiallyafterhavingrecentlycompletedabook onvectoranalysiswhereitwasnotevenmentioned!SowhyamIwritingasecondbookonthe samesubject?Wellit’snotbecauseIhavenothingbettertodowithmytime.Therearemanymore booksIhavetowritebeforegoingtothegreatlibraryinthesky! WhenIstarted writing GeometricAlgebraforComputerGraphics Iknewverylittleaboutthe subjectand hadtounderstand theconceptsasIwentalong—which wasextremelydifficult.In retrospect,theyearspentwritingthatbookwaslikeclimbingamountain,andaftercompleting the chapter on conformal geometry I had effectively reached the summit and, in terms of my understanding,theviewwascompelling.ButhavingreachedthesummitIthenhadtoracedown withmymanuscriptandsendittoSpringer. Inthefollowingweeksitwasdifficulttoforgetthepreviousyear’sjourney.HadIreallyunder- stoodgeometricalgebra?HadIreallylaidoutthesubjectinawaythatanyonecouldunderstand? Such questions bothered me on a daily basis, especially when walking my dog Monty. Such momentsgavemethetimetoreflectuponwhatwasreallybehindthealgebraandwhathadgone onbetweenHamilton,GrassmannandGibbswhenthefoundationsofvectoranalysiswerebeing establishedahundredandfiftyyearsago. BackinmyofficeIstartedtoexplorevectorproductsfromasymbolicstandpointandrealized that if two vectors are expanded algebraically,four terms result from two 2D vectors and nine termsfromtwo3Dvectors.Nothingnew,orearthshattering.However,ifthesetermsaredivided intotwosets,theygiverisetotheinnerandouterproducts: ab=a·b+a∧b whichisClifford’soriginalgeometricproduct. I also found that when such products are expanded in tabular form, and colour is used to highlighttheinnerandouterproductterms,thedifferencebetweenthetwosetsbecamestrikingly obvious.IimmediatelyaskedSpringerforpermissiontousecolourthroughoutanewbookon geometricalgebra,whichwouldhopefullywouldopenupthesubjecttoawideraudience. vii viii Preface Icontinuedtoapplythesamealgebraictreatmenttovectors,bivectorsandtrivectorsandthen discovered that I had been using something called dyads, which had been employed by Gibbs in his work on vectors. Far from being disappointed,I continued in the knowledge that I was probablyontherighttrack. Thebook’sstructureemergedwithouttoomucheffort:Thefirstchapter,whichwasthelastto bewritten,brieflyexplorestheimportantrolethataxiomsplayinmathematicsandhowwehave struggledduringpreviouscenturiestoacceptnon-sensicalideassuchasintersectingparallellines, infinitesetsandimaginarynumbers.Thisistopreparethereaderforideassuchasmultiplyinga linebyanarea,squaringanarea,oraddingscalars,lines,areasandvolumestocreateamultivector. ItremindsmeofthetimeIwrotesomecodetoaddtheshapesofanelephantandseahorsetogether, ordivideacirclebyatriangle.Totallynon-sensical,butveryuseful! The second chapter reviews the productsof real algebra,complexnumbers and quaternions usingthesametablesemployedlaterforgeometricalgebra. Thethirdchapterisonvectorproductsandreviewsthetraditionalscalarandvectorproducts intabularform.Dyadicsarethenintroducedandleadontoadescriptionoftheouterproductin 2Dand3D. Chapterfour introduces the geometric product as the sum of the inner and outerproducts. Bladesaredefinedandthechapterconcludesbyexploringthegeometricproductofvarioustypes ofvectors. Having laid the foundations for geometric algebra in the first four chapters, chapter five describes features such as grades,pseudoscalars,multivectors,reversion,inversion,duality and theimaginaryandrotationalpropertiesofbivectors. Next,chaptersixcoversallthepossibleproductsbetweenvectorsandbivectorsin2D.Similarly, chapter seven covers all the possible products between vectors, bivectors and trivectors in 3D. Tablesandcolourplayanimportantroleinrevealingthenaturalpatternsthatresultfromthese products. Chaptereightshowshowpowerfulgeometricalgebraiswhenhandlingreflectionsandrotations, andatthispointwediscoverthatquaternionsareanaturalfeatureofgeometricalgebra. Chapternineexploresawiderangegeometricproblemsencounteredincomputergamesand computer animation problems. It is far from exhaustive, but provides strategies that can be employedinallsortsofsimilarproblems. Finally,chaptertendrawsthebooktoaconclusion. Having written these ten chapters I hope that I have finally found a straightforward way of describing geometric algebra that will enable it to be used by anyone working in computer graphics. Ishouldsaysomethingaboutthenotationemployedinthebook.Vectorsarenormallyshown inaboldtypeface,todistinguishthemfromscalarquantities.Butasvirtuallyeveryequationrefer- encesvectors,IhavefollowedChrisDoranandAnthonyLasenby’sleadandleftthemuntouched. Thereisnoconfusionbetweenvectorsandscalars,asyouwilldiscover. IwouldliketoacknowledgethatIcouldnothavewrittenthisbookwithouttheexistenceof GeometricAlgebraforPhysicistswrittenbyChrisDoranandAnthonyLasenby.Itprovidesthemost lucidintroductiontogeometricalgebra.Similarly,MichaelCrowe’sAHistoryofVectorAnalysisis thebestbookonthesubject. Preface ix Once again, I am indebted to Beverley Ford, General Manager, Springer UK, and Helen Desmond, Assistant Editor for Computer Science, for their continual support throughout the developmentofthismanuscript. Idohopeyouenjoyreadinganddiscoveringsomethingnewfromthisbook. Ringwood JohnVince Contents Preface.............................................................................. vii Symbolsandnotation .............................................................. xvii 1 Introduction..................................................................... 1 1.1 Senseandnonsense.................................................................... 1 1.2 Geometricalgebra...................................................................... 2 2 Products......................................................................... 5 2.1 Introduction ............................................................................. 5 2.2 Realproducts............................................................................ 5 2.3 Complexproducts ...................................................................... 7 2.4 Quaternionproducts ................................................................... 8 2.5 Summary ................................................................................ 11 3 VectorProducts ................................................................. 13 3.1 Introduction ............................................................................. 13 3.2 Thescalarproduct ...................................................................... 13 3.3 Thevectorproduct...................................................................... 14 3.4 Dyadics................................................................................... 16 3.5 Theouterproduct....................................................................... 20 3.5.1 Originsoftheouterproduct.................................................. 20 3.5.2 Thegeometricmeaningoftheouterproductin2D........................ 21 xi xii Contents 3.5.3 Thegeometricmeaningoftheouterproductin3D........................ 25 3.6 Summary ................................................................................ 32 4 TheGeometricProduct.......................................................... 33 4.1 Introduction ............................................................................. 33 4.2 Axioms ................................................................................... 33 4.3 Redefiningtheinnerandouterproducts............................................. 37 4.4 Blades .................................................................................... 41 4.5 Thegeometricproductofdifferentvectors .......................................... 42 4.5.1 Orthogonalvectors............................................................ 43 4.5.2 Parallelvectors ................................................................. 44 4.5.3 Linearlyindependentvectors................................................. 44 4.6 Summary ................................................................................ 47 5 GeometricAlgebra .............................................................. 49 5.1 Introduction ............................................................................. 49 5.2 Gradesandpseudoscalars ............................................................. 49 5.3 Multivectors ............................................................................. 50 5.4 Reversion ................................................................................ 53 5.5 Theinverseofamultivector............................................................ 54 5.6 Theimaginarypropertiesoftheouterproduct...................................... 58 5.7 Therotationalpropertiesofthe2Dunitbivector.................................... 59 5.8 Theimaginarypropertiesofthe3Dunitbivectorandthetrivector ............... 60 5.9 Duality ................................................................................... 61 5.10 Summary ................................................................................ 64 6 Productsin2D................................................................... 65 6.1 Introduction ............................................................................. 65 6.2 Thescalar-vectorproduct.............................................................. 66 6.3 Thescalar-bivectorproduct............................................................ 67 6.4 Thevector-vectorproducts ............................................................ 67 6.4.1 Theinnerproduct.............................................................. 67 6.4.2 Theouterproduct.............................................................. 69 6.4.3 Thegeometricproduct........................................................ 70 6.5 Thevector-bivectorproduct........................................................... 71
Description: