Download as pdf or txt
Download as pdf or txt
You are on page 1of 70

The Power of Geometric Algebra

Computing: For Engineering and


Quantum Computing 1st Edition
Dietmar Hildenbrand
Visit to download the full and correct content document:
https://ebookmeta.com/product/the-power-of-geometric-algebra-computing-for-engine
ering-and-quantum-computing-1st-edition-dietmar-hildenbrand/
More products digital (pdf, epub, mobi) instant
download maybe you interests ...

Quantum Computing and Future Understand Quantum


Computing and Its Impact on the Future of Business 1st
Edition Utpal Chakraborty

https://ebookmeta.com/product/quantum-computing-and-future-
understand-quantum-computing-and-its-impact-on-the-future-of-
business-1st-edition-utpal-chakraborty/

Quantum Computing For Dummies William Hurley

https://ebookmeta.com/product/quantum-computing-for-dummies-
william-hurley/

Quantum Computing for Programmers Robert Hundt

https://ebookmeta.com/product/quantum-computing-for-programmers-
robert-hundt/

Productizing Quantum Computing: Bring Quantum Computing


Into Your Organization 1st Edition Dhairyya Agarwal

https://ebookmeta.com/product/productizing-quantum-computing-
bring-quantum-computing-into-your-organization-1st-edition-
dhairyya-agarwal/
Productizing Quantum Computing: Bring Quantum Computing
Into Your Organization 1st Edition Dhairyya Agarwal

https://ebookmeta.com/product/productizing-quantum-computing-
bring-quantum-computing-into-your-organization-1st-edition-
dhairyya-agarwal-2/

Quantum Computing for Everyone (The MIT Press) Chris


Bernhardt

https://ebookmeta.com/product/quantum-computing-for-everyone-the-
mit-press-chris-bernhardt/

Practical Quantum Computing for Developers 1st Edition


Vladimir Silva

https://ebookmeta.com/product/practical-quantum-computing-for-
developers-1st-edition-vladimir-silva/

Introducing Microsoft Quantum Computing for Developers:


Using the Quantum Development Kit and Q# Johnny
Hooyberghs

https://ebookmeta.com/product/introducing-microsoft-quantum-
computing-for-developers-using-the-quantum-development-kit-and-q-
johnny-hooyberghs/

Fundamentals of Quantum Computing: Theory and Practice


Venkateswaran Kasirajan

https://ebookmeta.com/product/fundamentals-of-quantum-computing-
theory-and-practice-venkateswaran-kasirajan/
The Power of
Geometric Algebra
Computing
The Power of
Geometric Algebra
Computing

Dietmar Hildenbrand
MATLAB • is a trademark of The MathWorks, Inc. and is used with permission. The MathWorks
does not warrant the accuracy of the text or exercises in this book. This book’s use or discus-
sion of MATLAB • software or related products does not constitute endorsement or sponsorship
by The MathWorks of a particular pedagogical approach or particular use of the MATLAB •
software.

First edition published 2022


by CRC Press
6000 Broken Sound Parkway NW, Suite 300, Boca Raton, FL 33487-2742

and by CRC Press


2 Park Square, Milton Park, Abingdon, Oxon, OX14 4RN

© 2022 Dietmar Hildenbrand

CRC Press is an imprint of Taylor & Francis Group, LLC

Reasonable efforts have been made to publish reliable data and information, but the author and
publisher cannot assume responsibility for the validity of all materials or the consequences of
their use. The authors and publishers have attempted to trace the copyright holders of all mate-
rial reproduced in this publication and apologize to copyright holders if permission to publish
in this form has not been obtained. If any copyright material has not been acknowledged please
write and let us know so we may rectify in any future reprint.

Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, repro-
duced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now
known or hereafter invented, including photocopying, microfilming, and recording, or in any
information storage or retrieval system, without written permission from the publishers.

For permission to photocopy or use material electronically from this work, access www.copy-
right.com or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers,
MA 01923, 978-750-8400. For works that are not available on CCC please contact mpkbooksper-
missions@tandf.co.uk

Trademark notice: Product or corporate names may be trademarks or registered trademarks and
are used only for identification and explanation without intent to infringe.

ISBN: 978-0-367-68458-7 (hbk)


ISBN: 978-0-367-68775-5 (pbk)
ISBN: 978-1-003-13900-3 (ebk)

DOI: 10.1201/9781003139003

Typeset in Nimbus Roman


by KnowledgeWorks Global Ltd.
Figure 1 Zeeland impression.

To Zeeland and all the wonderful memories and future


experiences
Contents

List of Figures xiii

List of Tables xvii

Foreword xix

Preface xxi

CHAPTER 1  Introduction 1
1.1 GEOMETRIC ALGEBRA 1
1.2 GEOMETRIC ALGEBRA COMPUTING 2
1.3 OUTLINE 3

CHAPTER 2  Geometric Algebras for Engineering 5


2.1 THE BASICS OF GEOMETRIC ALGEBRA 5
2.2 CONFORMAL GEOMETRIC ALGEBRA (CGA) 8
2.2.1 Geometric Objects of Conformal Geometric Algebra 9
2.2.2 Angles and Distances in 3D 10
2.2.3 3D Transformations 10
2.3 COMPASS RULER ALGEBRA (CRA) 13
2.3.1 Geometric Objects 13
2.3.2 Angles and Distances 16
2.3.3 Transformations 16
2.4 PROJECTIVE GEOMETRIC ALGEBRA (PGA) WITH GANJA 17
2.4.1 2D PGA 17
2.4.2 3D PGA 19

CHAPTER 3  GAALOP 25
3.1 INSTALLATION 26
3.2 GAALOPSCRIPT 27

vii
viii  Contents

3.2.1 The Main Notations 29


3.2.2 Macros and Pragmas 30
3.2.3 Bisector Example 31
3.2.4 Line-Sphere Example 31

CHAPTER 4  GAALOPWeb 33
4.1 THE WEB INTERFACE 34
4.2 THE WORKFLOW 34
4.3 GAALOPWEB VISUALIZATIONS 35
4.3.1 Visualization of the Bisector Example 35
4.3.2 Visualization of the Rotation of a Circle 36
4.3.3 Visualization of the Line-Sphere Example 38
4.3.4 Visualization of a Sphere of Four Points 38
4.3.5 Sliders 39

CHAPTER 5  GAALOPWeb for C/C++ 41


5.1 GAALOPWEB HANDLING 41
5.2 CODE GENERATION AND RUNTIME PERFORMANCE
BASED ON GAALOPWEB 45

CHAPTER 6  GAALOPWeb for Python 49


6.1 THE WEB INTERFACE 49
6.2 THE PYTHON CONNECTOR FOR GAALOPWEB 51
6.3 CLIFFORD/PYGANJA 53
6.4 GAALOPWEB INTEGRATION INTO CLIFFORD/PYGANJA 55
6.5 USING PYTHON TO GENERATE CODE NOT SUPPORTED
BY GAALOPWEB 56

CHAPTER 7  Molecular Distance Application Using GAALOP-


Web for Mathematica 59
7.1 DISTANCE GEOMETRY EXAMPLE 60
7.2 GAALOPWEB FOR MATHEMATICA 62
7.2.1 Mathematica Code Generation 62
7.2.2 The Web-Interface 64
7.3 COMPUTATIONAL RESULTS 65
Contents  ix

CHAPTER 8  Robot Kinematics Based on GAALOPWeb for


MATLAB R 71
8.1 THE MANIPULATOR MODEL 72
8.2 KINEMATICS OF A SERIAL ROBOT ARM 72
8.3 MATLAB R TOOLBOX IMPLEMENTATION 75
8.4 THE GAALOP IMPLEMENTATION 77
8.5 GAALOPWEB FOR MATLAB R 79
8.6 COMPARISON OF RUN-TIME PERFORMANCE 80

CHAPTER 9  The Power of High-Dimensional Geometric Al-


gebras 83
9.1 GAALOP DEFINITION 83
9.2 VISUALIZATION 85

CHAPTER 10  GAALOPWeb for Conics 87


10.1 GAALOP DEFINITION 87
10.1.1 definition.csv 87
10.1.2 macros.clu 88
10.2 GAC OBJECTS 89
10.3 GAC TRANSFORMATIONS 94
10.4 INTERSECTIONS 97

CHAPTER 11  Double Conformal Geometric Algebra 101


11.1 GAALOP DEFINITION OF DCGA 101
11.2 THE DCGA OBJECTS 103
11.2.1 Ellipsoid, Toroid and Sphere 103
11.2.2 Planes and Lines 106
11.2.3 Cylinders 108
11.2.4 Cones 109
11.2.5 Paraboloids 111
11.2.6 Hyperboloids 113
11.2.7 Parabolic and Hyperbolic Cylinders 115
11.2.8 Specific Planes 117
11.2.9 Cyclides 118
11.3 THE DCGA TRANSFORMATIONS 119
11.4 INTERSECTIONS 121
x  Contents

11.5 REFLECTIONS AND PROJECTIONS 122


11.6 INVERSIONS 123

CHAPTER 12  Geometric Algebra for Cubics 125


12.1 GAALOP DEFINITION 125
12.2 CUBIC CURVES 128

CHAPTER 13  GAALOPWeb for GAPP 131


13.1 THE REFLECTOR EXAMPLE 131
13.2 THE WEB INTERFACE 132
13.3 GAPP CODE GENERATION 133

CHAPTER 14  GAALOPWeb for GAPPCO 135


14.1 GAPPCO IN GENERAL 136
14.2 GAPPCO I 138
14.2.1 GAPPCO I Architecture 138
14.2.2 The Compilation Process 139
14.2.3 Configuration Phase 140
14.2.4 Runtime Phase 143
14.3 THE WEB INTERFACE 144

CHAPTER 15  GAPPCO II 147


15.1 THE PRINCIPLE 147
15.2 EXAMPLE 148
15.3 IMPLEMENTATION ISSUES 149

CHAPTER 16  Introduction to Quantum Computing 153


16.1 COMPARING CLASSIC COMPUTERS WITH QUANTUM
COMPUTERS 153
16.2 DESCRIPTION OF QUANTUM BITS 154
16.3 QUANTUM REGISTER 156
16.4 COMPUTING STEPS IN QUANTUM COMPUTING 157
16.4.1 The NOT-Operation 157
16.4.2 The Hadamard Transform 159
16.4.3 The CNOT-Operation 161
Contents  xi

CHAPTER 17  GAALOPWeb as a Qubit Calculator 163


17.1 QUBIT ALGEBRA QBA 163
17.2 GAALOPWEB FOR QUBITS 164
17.3 THE NOT-OPERATION ON A QUBIT 165
17.4 THE 2-QUBIT ALGEBRA QBA2 165

CHAPTER 18  Appendix 169


18.1 APPENDIX A: PYTHON CODE FOR THE GENERATION OF
OPTIMIZED MATHEMATICA CODE FROM GAALOP 169

Bibliography 173

Index 177
List of Figures

1 Zeeland impression. v

1.1 Screenshot of https://bivector.net. 2

2.1 The intersection of two spheres results in a circle. 10


2.2 Translation of a sphere from the origin to the point Pt . 12
2.3 Vis2d Visualization of the perpendicular bisector between the two
(red) points. 15
2.4 The basics of the 2D Projective Geometric Algebra according to [13]. 18
2.5 Geometry basics of the 2D Projective Geometric Algebra according
to [13]. 19
2.6 Visualization of the Listing 2.1. 20
2.7 Geometry basics of the 3D Projective Geometric Algebra according
to [13]. 21
2.8 Norms and motors of the 3D Projective Geometric Algebra accord-
ing to [13]. 22
2.9 Visualization of the Listing 2.2. 23

3.1 Global Setting Plugin for the configuration of Maxima (as well as
font sizes). 26
3.2 Configuration of GAALOP for visualizations based on Compass
Ruler Algebra. 26
3.3 Screenshot of the editor, the visualization and the output window of
GAALOP. 27
3.4 Spheres and lines are basic entities of Geometric Algebra that one
can compute with. Intersection of these objects are easily expressed
with the help of their outer product. Here, one of the two points of
the intersection of the sphere and the line is shown in blue. 32

4.1 The programming language selection of GAALOPWeb. 33


4.2 The screen of GAALOPWeb for Python. 34
4.3 GAALOPWeb visualization of the bisector example. 36

xiii
xiv  List of Figures

4.4 GAALOPWeb visualization of the rotation of a circle. 37


4.5 Visualization of the Listing 4.4 with four points defining a sphere. 39

5.1 The sphere-centre example with GAALOPWeb. 42


5.2 The result of the sphere-center example. 42
5.3 The sphere-centre example without the P1z variable. 43
5.4 The result of the sphere-center example with a default slider for the
P1z variable. 43
5.5 The sphere-centre example with a user-defined slider definition. 44
5.6 The result of the sphere-centre example with a user-defined slider
for the P1z variable. 44

6.1 The line-sphere example with GAALOPWeb. 50


6.2 The result of the line-sphere example with GAALOPWeb. 51
6.3 Jupyter notebook of the line-sphere example based on the Python
Connector of GAALOPWeb (Part I). 52
6.4 Jupyter notebook of the line-sphere example based on the Python
Connector of GAALOPWeb (Part II). 52
6.5 Jupyter notebook for the visualization of the line-sphere example. 53
6.6 Simple visualization of some geometric objects with pyganja. 54
6.7 Pyganja scenegraph visualization. 55
6.8 Jupyter notebook of the line-sphere example based on the Python
Connector of GAALOPWeb (Part II). 56

7.1 Figure generated in Mathematica for the example above. The points
in black are exactly the points found by the CGA function. 64
7.2 Screenshot of GAALOPWeb. 65
7.3 Output of GAALOPWeb. 66

8.1 Manipulator model description. 73


8.2 The screen of GAALOPWeb for MATLAB. 80
8.3 Motion of the robot: left – MATLAB-optimized code, right – ABB
Robot Studio. This shows that the functionality of both algorithms
is identical. 81
8.4 Measuring of the runtime through the whole robot’s motion. 82

10.1 An ellipse to be visualized. 90


10.2 The visualization of an ellipse with GAALOPWeb. 91
10.3 The result of Listing 10.5. 92
List of Figures  xv

10.4 GAALOPWeb visualization of two intersecting lines based on 5


points. 93
10.5 GAALOPWeb visualization of an ellipse based on 5 points. 94
10.6 GAALOPWeb visualization of a hyperbola based on 5 points. 94
10.7 GAALOPWeb visualization of some transformations of an ellipse. 96
10.8 GAALOPWeb visualization for dilations of conics. 97
10.9 Visualization of the intersection of ellipse and circle. 98
10.10 Visualization result of Listing 10.12. 99

11.1 Vis3D settings. 105


11.2 Vis3D visualization of ellipsoid, toroid and sphere. 106
11.3 Vis3D visualization of plane and line. 107
11.4 Vis3D visualization of cylinders. 109
11.5 Vis3D visualization of cones. 111
11.6 Vis3D visualization of paraboloids. 113
11.7 Vis3D visualization of an hyperboloid. 114
11.8 Vis3D visualization of cyclides. 118
11.9 Vis3D visualization of transformations of an ellipsoid. 120
11.10 Vis3D visualization of the intersection of an ellipsoid and a line. 121
11.11 Vis3D visualization of conics in space. 122
11.12 Vis3D visualization of the reflection and projection of a line onto a
sphere. 123
11.13 Vis3D visualization of the inversion of a toroid. 124

12.1 Vis3D visualization of a simple cubic curve. 129

13.1 Reflection of a sphere according to the algorithm of Listing 13.1. 132


13.2 Screenshot of “GAALOPWeb for GAPP”. 133

14.1 GAPPCO co-processor with host interface. 136


14.2 GAPP unit processing an input Vector (vector with all the scalar
input values) to resulting vectors. 137
14.3 GAPP unit consisting of 2 levels of DotVectors units. 137
14.4 Parallel dot product of two n-dimensional vectors Vector0 and Vec-
tor1 (n parallel products followed by log(n) parallel addition steps). 138
14.5 Configurable GAPPCO I block diagram. 138
14.6 DotVectors1 block diagram. 139
14.7 GAPP unit configured to execute reflection operations. 140
xvi  List of Figures

14.8 Internal configuration data structure for GAPPCO based on the re-
flection example. 141
14.9 Screenshot of “GAALOPWeb for GAPPCO”. 144

15.1 The general GAPPCO II design. 147


15.2 The parallel computing layer. 148
15.3 Mapping of a DotVectors unit into the GAPPCO II design. 148
15.4 Step 1. 149
15.5 Step 2. 149
15.6 Step 2A. 150
15.7 Step 1. 150
15.8 Step 2. 151
15.9 Step 3. 151
15.10 Different processing times. 152

16.1 State vector ψ of a quantum register built from two quantum bits
according to [41]. 156
16.2 Reflection about the reflection vector. 158
16.3 Graphical illustration of the Hadamard transform according to [41]. 160

17.1 Screenshot of GAALOPWeb for Qubit algebras. 164


List of Tables

2.1 Notations of Geometric Algebra 6


2.2 Properties of the Outer Product ∧ 6
2.3 The 32 basis blades of the 5D Conformal Geometric Algebra (Con-
formal Geometric Algebra) 8
2.4 The two representations (IPNS and OPNS) of conformal geomet-
ric entities. They are duals of each other, which is indicated by the
asterisk symbol. 9
2.5 Geometric Meaning of the Inner Product of Planes, Spheres and
Points 11
2.6 The 16 Basis Blades of the Compass Ruler Algebra (to be identified
by their indices) 14
2.7 The Representations of the Geometric Objects of the Compass
Ruler Algebra 15
2.8 Geometric Meaning of the Inner Product of Lines, Circles and Points 16
2.9 The Description of Transformations of a Geometric Object o in
Compass Ruler Algebra (please note that LoL means the geomet-
ric product of L, o and L) 16

3.1 The Main Notations of GAALOPScript 28


3.2 Notations of GAALOPScript for CGA/CRA 29
3.3 Macros of GAALOPScript for Conformal Geometric Algebra 30
3.4 Pragmas of GAALOPScript 31

7.1 The Results for the Function DGPSolver [61] Running the Conven-
tional and the CGA approach. 69

8.1 Computation Time of Algorithms in (s) 81


8.2 Computational Computer Specification 81

14.1 Configuration bits for DotVectors1 of Fig. 14.6. (A register file com-
posed of 32 32-bit registers has been considered for this first design
and therefore 5-bit addresses are needed.) 142

xvii
xviii  List of Tables

14.2 Configuration Bitstream of GAPPCO I 143


14.3 Configuration Bitstream for GAPP unit Realizing reflector Func-
tionality 145

17.1 The 4 Basis Vectors of the Qubit Algebra 164


17.2 The 8 Basis Vectors of the 2-Qubit Algebra QBA2 166
Foreword

Geometric algebras have proved to be useful in engineering applications during the


past three decades. It all began with Conformal Geometric Algebra (CGA) as a model
of three-dimensional Euclidean space and its two-dimensional version, Compass
Ruler Algebra (CRA). Both these outstanding algebras from the computing point
of view were a topic for the previous two books by Dietmar Hildenbrand. It is only
natural that his new book is treating newly reinvented structures, such as Projective
Geometric Algebra (PGA), Geometric Algebra for Conics (GAC) or a Clifford al-
gebra for quantum computing, Quantum Bit Algebra (QBA). The uniting element in
all books by Dietmar Hildenbrand is GAALOP or its online version GAALOPWeb.
Indeed, as the range of applications is growing, there is a need for a tool that is sim-
ply implementing symbolic operations in particular Clifford algebras into a code that
can be easily included in standard programming languages or engineering software
tools. Furthermore, if a geometric algorithm is precompiled by GAALOP, all oper-
ations are optimized with respect to the computational complexity. The advantage
of such an approach lies also in the fact that the dimension of a Clifford algebra is
not such a serious limitation regarding the number of operations and computational
load. And finally, the geometric nature of the algorithms demands geometric imag-
ination which has to be verified. Thus, GAALOPWeb provides a visualiszation tool
based on a Python module, Ganja, where the geometric ideas may be checked in-
stantly. Analogously to the previous books, even this one is easy to read because the
author provides examples of applications for particular topics. Together with sym-
bolic calculations, the reader finds code in the language for GAALOPWeb, which
is GAALOPScript. Therefore, all applications may be simply checked, geometric
primitives and operations calculated and visualized. Special focus is on quantum
computing where GAALOPWeb serves also as a q-bit calculator. This is a novel
concept which deserves attention and GAALOPWeb again proved its universality in
accommodating different structures. After introducing the basics of geometric alge-
bra computing for CGA, CRA and PGA, the book continues with the description
of GAALOPWeb functionalities, including visualization. Consequently, four possi-
bilities of generating a code for particular programming languages and engineering
tools are described in their respective chapters. This includes C/C++, Python, Math-
ematica and MATLAB R , respectively. Each description is accompanied by specific
engineering applications containing the code in GAALOPScript for instant verifica-
tion in GAALOPWeb. Chapters 8 to 10 summarise the power of GAALOPWeb when
used for high-dimensional geometric algebras, such as Double Conformal Geomet-
ric Algebra, Geometric Algebra for Conics and for Cubics. Subsequent two chapters

xix
xx  Foreword

deal with GAPP, the intermediate language of GAALOP and its implementation in
GAALOPWeb. This is very suitable for hardware implementations; one of them is
the Geometric Algebra hardware design GAPPCO I and, newly, GAPPCO II. Chap-
ter 15 and the remaining chapters introduce the concept of quantum computing in
a geometric algebra setting. Even in this area, GAALOPWeb proved its quality and
is used as a q-bit calculator. As a summary, I believe that this book may well serve
to support geometric algebras in penetrating engineering applications, yet it is suit-
able even in academia where it can guide both students and teachers in a fancy way.
Indeed, the potential of geometric algebras may be exploited if and only if it can be
introduced to a wide audience, and to do so, the calculations must be simple to imple-
ment, possible to be included in standard engineering software tools and visualized.
And this is precisely what this book is about. It is my pleasure that the book will be
introduced on the occasion of the 8th Conference on Applied Geometric Algebras in
Computer Science and Engineering (AGACSE) in Brno, Czech Republic, 2021.
Prof. Petr Vasik
Brno University of Technology
Brno, Czech Republic
April 1, 2021
Preface

Geometric Algebra is a very powerful mathematical system for an easy and intuitive
treatment of geometry, but the community working with it is still very small. The
main goal of this book is to close this gap from a computing perspective in presenting
the power of Geometric Algebra Computing for engineering applications and quan-
tum computing. The intended audience includes students, engineers and researchers
interested in really computing with Geometric Algebra.
Today, we indeed have the Geometric Algebra Computing technology available
for easy-to-develop, geometrically intuitive, robust and fast engineering applications.
We are happy to provide GAALOPWeb, the web-based version of our GAALOP
(GEOMETRIC ALGEBRA ALGORITHMS OPTIMIZER) compiler for the integra-
tion of Geometric Algebra into standard programming languages. Besides the gener-
ation of optimized code for languages such as C++, Python, Mathematica, MATLAB
and many others, GAALOPWeb can also be used for the configuration of a specific
Geometric Algebra hardware, the GAPPCO1 co-processor. It is also able to visual-
ize Geometric Algebra algorithms. GAALOPWeb can be used easily on PC, smart
phone, tablet etc. without any software installation.
While The Power of Geometric Algebra Computing really focuses on the easy-to-
handle computing with Geometric Algebra, there is a following relation to my former
books: Foundation of Geometric Algebra Computing[29] focuses on the GAALOP
technology itself and on 3D applications for computer graphics, computer vision and
robotics. The second book Introduction to Geometric Algebra Computing[30] is in-
tended to give a rapid introduction to computing with Geometric Algebra. From the
point of view of geometric objects, it focuses on the most basic ones, namely points,
lines and circles. We call this algebra Compass Ruler Algebra, since you are able to
handle it comparably to working with a compass and ruler. It offers the possibility
to compute with these geometric objects, their geometric operations and transforma-
tions in a very intuitive way. While focusing on 2D, it is easily expandable to 3D
computations as used in many books dealing with the popular Conformal Geometric
Algebra.
The power of Geometric Algebra Computing can also be studied in this book by
using high dimensional algebras for the handling of more complex geometric objects
such as conics, quadrics and cyclides. Last, but not least, the advantageous use of
Geometric Algebra for quantum computing is demonstrated.
1 Geometric algorithms parallelization programs co-processor

xxi
xxii  Preface

I really do hope that this book can support the widespread use of Geometric Alge-
bra as a mathematical tool for computing with geometry in engineering applications
as well as in quantum computing.

Dr. Dietmar Hildenbrand


Acknowledegments

I would like to thank Dr.-Ing. Christian Steinmetz for his tremendous support to this
book. He developed GAALOPWeb as used in this book during his PhD phase.
Many thanks to
- the group of Prof. Petr Vasik from Brno University of Technology for their
support concerning the robot application, the Geometric Algebra of conics and
quantum computing,
- Prof. Rafael Alves (Universidade Federal do ABC, Brasil) for his support
regarding the molecular distance application as well as the application of Ge-
ometric Algebra to quantum computing,

- Dr. Silvia Franchini, Prof. A. Gentile, Prof. G. Vassallo and Prof. S. Vitabile
from the University of Palermo for the cooperation regarding the new co-
processor design GAPPCO I,
- Robert Easter for the first integration of Double Conformal Geometric Alge-
bra into GAALOP and his support with test scripts,

- Senior Associate Prof. Eckhard Hitzer for many fruitful discussions and for
his big effort and enthusiasm for the promotion of Geometric Algebra (and
computing with it).

xxiii
CHAPTER 1

Introduction
CONTENTS
1.1 Geometric Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Geometric Algebra Computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Outline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Geometric Algebra is a very powerful mathematical language combining geometric


intuitivity with the potential of high runtime-performance of the implementations.
This book on hand is based on GAALOPWeb, a new user-friendly, web-based tool for
the generation of optimized code for different programming languages as well as for
the visualization of Geometric Algebra algorithms for a wide range of engineering
applications. It includes applications from the fields of computer graphics, robotics
and quantum computing.
The book Foundations of Geometric Algebra Computing [29] describes
GAALOP (see Chapt. 4) in a very fundamental way, since it breaks down the comput-
ing of Geometric Algebra algorithms into the most basic arithmetic operations. This
book on hand makes use of its web-based extention GAALOPWeb (see Chapt. 4).
This book is suitable as a starting point for computing with Geometric Algebra
for everybody interested in it as a new powerful mathematical system, especially
for students, engineers and researchers in engineering, computer science, quantum
computing and mathematics.

1.1 GEOMETRIC ALGEBRA


The main advantage of Geometric Algebra is its easy and intuitive treatment of ge-
ometry.
Geometric Algebra is based on the work of the German high school teacher Her-
mann Grassmann and his vision of a general mathematical language for geometry.
His very fundamental work, called Ausdehnungslehre[24], was little noted in his
time. Today, however, Grassmann is more and more respected as one of the most
important mathematicians of the 19th century.
William Clifford [11] combined Grassmann’s exterior algebra and Hamilton’s
quaternions in what we call Clifford algebra or Geometric Algebra1 . Pioneering work
1 David Hestenes writes in his article [27] about the genesis of Geometric Algebra: Even today math-

ematicians typically typecast Clifford Algebra as the “algebra of a quadratic form,” with no awareness

DOI: 10.1201/9781003139003-1 1
2  The Power of Geometric Algebra Computing

has been done by David Hestenes. Especially interesting for this book is his work on
Conformal Geometric Algebra (CGA) [26] [50].

1.2 GEOMETRIC ALGEBRA COMPUTING


Especially since the introduction of Conformal Geometric Algebra (see Sect. 2.2)
there has been an increasing interest in using Geometric Algebra in engineering. The
use of Geometric Algebra in engineering applications relies heavily on the avail-
ability of an appropriate computing technology. The main problem of Geometric
Algebra Computing is the exponential growth of data and computations compared to
linear algebra, since the multivector2 of an n-dimensional Geometric Algebra is 2n -
dimensional. For the 5-dimensional Conformal Geometric Algebra, the multivector
is already 32-dimensional.
An approach to overcome the runtime limitations of Geometric Algebra has been
achieved through optimized software solutions. Tools have been developed for high-
performance implementations of Geometric Algebra algorithms such as the C++
software library generator Gaigen 2 from Daniel Fontijne and Leo Dorst of the Uni-
versity of Amsterdam [21], GMac from Ahmad Hosney Awad Eid of Suez Canal
University [20], the Versor library [12] from Pablo Colapinto and the C++ expres-
sion template library Gaalet [60] from Florian Seybold of the University of Stuttgart.
BiVector.net (see Figure 1.1) gives a good overview over software solutions for

Figure 1.1 Screenshot of https://bivector.net.

Geometric Algebra. It provides code generators for C++, C#, Python, Rust as well as
starting points for libraries for Python, C/C++, Julia and the JavaScript visualization
tool Ganja (see Sect. 2.4).
Our GAALOP compiler [32] is not specific for one programming language but
supports many of them. It can be used as a compiler for languages such as C/C++,

of its grander role in unifying geometry and algebra as envisaged by Clifford himself when he named it
Geometric Algebra. It has been my privilege to pick up where Clifford left off — to serve, so to speak, as
principal architect of Geometric Algebra and Calculus as a comprehensive mathematical language for
physics, engineering and computer science.
2 The main algebraic element of Geometric Algebra (please refer to Sect. 2.2)
Introduction  3

C++ AMP, OpenCL and CUDA [29] [31] as well as Python, MATLAB, Mathemat-
ica,
Julia or Rust. Please find details about GAALOP in Chapt. 3 and about its web-based
extension GAALOPWeb in Chapt. 4.

1.3 OUTLINE
Chapt. 2 presents the most important Geometric Algebras for engineering, namely
Conformal Geometric Algebra (CGA), Compass Ruler Algebra (CRA) and Projec-
tive Geometric Algebra (PGA).
Chapt. 3 is dealing with GAALOP and Chapt. 4 with GAALOPWeb, our new
user-friendly, web-based version of GAALOP for a wide range of engineering appli-
cations based on Geometric Algebra algorithms. It makes it much easier for users
to generate optimized source code without any software installation. GAALOP-
Script, the language to describe Geometric Algebra algorithms for the handling with
GAALOPWeb is presented in Sect. 3.2. GAALOPWeb supports the user with visu-
alizations of Geometric Algebra algorithms as demonstrated in Sect. 4.3. The visu-
alization is based on Ganja as described in Sect. 2.4.
In the following chapters some applications of GAALOPWeb for different pro-
gramming languages are presented. GAALOPWeb for C/C++ is presented in Chapt.
5 and GAALOPWeb for Python in Chapt. 6. A Molecular Distance Application us-
ing GAALOPWeb for Mathematica is shown in Chapt. 7 and an application of robot
kinematics based on GAALOPWeb for Matlab in Chapt. 8.
The power of high-dimensional Geometric Algebras, as presented in Chapt. 9,
comes with their ability to easily handle complex geometric objects. While the de-
fault Geometric Algebra of GAALOPWeb is the 5D Conformal Geometric Algebra
with points, spheres, planes, circles and lines as geometric objects, three additional
algebras are presented. The handling of conics in GAALOPWeb is shown in Chapt.
10. Quadrics as another example of geometric objects, which are interesting for ap-
plications, are handled in Chapt. 11 and cubics in Chapt. 12.
Geometric Algebra has an inherent potential for parallelization. This can be very
well seen in an intermediate language of GAALOP called GAPP. Chapt. 13 de-
scribes GAALOPWeb for this language which is very well suitable for hardware
implementations. Chapt. 14 shows, how GAALOPWeb for GAPPCO is dealing with
the Geometric Algebra hardware design GAPPCO. Chapt. 15 describes a new hard-
ware design called GAPPCO II.
Also quantum computing benefits a lot from Geometric Algebra. This is due to its
ability to describe the quantum bit (qubit) operations as geometric transformations.
The basics of quantum computing are presented in Chapt. 16. The principle of a new
Geometric Algebra for qubits together with some examples is presented in Chapt.
17. We extended GAALOPWeb for it in a way to use it as a qubit calculator.
CHAPTER 2

Geometric Algebras for


Engineering
CONTENTS
2.1 The Basics of Geometric Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Conformal Geometric Algebra (CGA) . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2.1 Geometric Objects of Conformal Geometric Algebra . . 9
2.2.2 Angles and Distances in 3D . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.2.3 3D Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3 Compass Ruler Algebra (CRA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.3.1 Geometric Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.3.2 Angles and Distances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.3.3 Transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.4 Projective Geometric Algebra (PGA) with Ganja . . . . . . . . . . . . . 17
2.4.1 2D PGA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.4.2 3D PGA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

This chapter presents the basics of Geometric Algebra as well as the most important
Geometric Algebras for engineering, namely Conformal Geometric Algebra (CGA),
Compass Ruler Algebra (CRA) and Projective Geometric Algebra (PGA).

2.1 THE BASICS OF GEOMETRIC ALGEBRA


The main product of Geometric Algebra is called the geometric product; many other
products can be derived from it. The three most often used products of Geometric
Algebra are the outer, the inner and the geometric product. The notations of these
products are listed in Table 2.1. We will use the outer product mainly for the con-
struction and intersection of geometric objects, while the inner product will be used
for the computation of angles and distances. The geometric product will be used
mainly for the description of transformations.
Basis Blades are the elementary algebraic elements of Geometric Algebra. An
n-dimensional Geometric Algebra consists of basis blades with grades 0 to n, where

DOI: 10.1201/9781003139003-2 5
6  The Power of Geometric Algebra Computing

TABLE 2.1 Notations of Geometric Algebra

Notation Meaning
AB Geometric product of A and B
A∧B Outer product of A and B
A·B Inner product of A and B
A−1 Inverse of A
à Reverse of A
A∗ Dual of A

TABLE 2.2 Properties of the Outer Product ∧

Property Meaning
Anticommutativity u ∧ v = −(v ∧ u)
Distributivity u ∧ (v + w) = u ∧ v + u ∧ w
Associativity u ∧ (v ∧ w) = (u ∧ v) ∧ w

a scalar is a 0-blade (a blade of grade 0) and the 1-blades are the basis vectors.
The 2-blades ei ∧ e j 1 are basis blades spanned by two 1-blades, and so on. There
exists only one element of the maximum grade n. It is therefore also called the pseu-
doscalar. A linear combination of k-blades is called a k-vector (or a vector, bivector,
trivector. . . . ). A linear combination of arbitrary blades is called a multivector. Mul-
tivectors are the general elements of a Geometric Algebra. The properties of the
outer product are listed in Table 2.2. The first property applies only to vectors; the
others are generally valid (and so they are also valid for multivectors). The outer
product of two parallel vectors is 0:

u ∧ u = −(u ∧ u) = 0. (2.1)

This is the reason why the outer product can be used as a measure of parallelness.
For Euclidean Geometric Algebras2 , the inner product u · v of two vectors is
the same as the well-known Euclidean scalar product of two vectors. For perpendic-
ular vectors, the inner product is 0; for instance, e1 · e2 = 0. In Geometric Algebra,
however, the inner product is not only defined for vectors. The inner product is grade-
decreasing; for example, the result of the inner product of elements with grade 2 and
1 is an element of grade 2 − 1 = 1. See Sect. 3.2.7 of [57] for a mathematical treat-
ment of the general inner product.
The geometric product AB is an amazingly powerful operation, which is used
mainly for the handling of transformations. The geometric product of vectors is a
combination of the outer product and the inner product. The geometric product of u
and v is denoted by uv. For vectors u and v, the geometric product uv can be defined
1 the symbol ∧ means the outer product of Geometric Algebra
2 all basis vectors square to 1
Geometric Algebras for Engineering  7

as
uv = u ∧ v + u · v. (2.2)
We derive the following for the inner and outer products:
1
u · v = (uv + vu), (2.3)
2
1
u ∧ v = (uv − vu). (2.4)
2

but, as noted above, these formulas apply only for vectors, in this form. See Chap. 3
of [57] for further details of the products of Geometric Algebra and especially Sect.
3.1 for an axiomatic approach to the geometric product.
The inverse A−1 of a blade A is defined by

AA−1 = 1.

The inverse of a vector v, for instance, is


v
v−1 = .
v·v
since
v v·v
v = = 1.
v·v v·v

The inverse of the vector v = 2e1 for instance results in 0.5e1 , since v · v = 2. See [39]
for details about multivector inverses.
Since the geometric product is invertible, divisions by algebraic expressions are
possible. The dual A∗ of an algebraic expression is calculated by dividing it by the
pseudoscalar I. In the following, the dual of the pseudoscalar e1 ∧ e2 is calculated. A
superscript ∗ means the dual operator.

(e1 ∧ e2 )∗ = (e1 ∧ e2 )(e1 ∧ e2 )−1

(e1 ∧ e2 )∗ = (e1 ∧ e2 ) (e1 ∧ e2 )−1


| {z }
−(e1 ∧e2 )

(e1 ∧ e2 ) = −(e1 ∧ e2 )(e1 ∧ e2 )
(e1 ∧ e2 )∗ = − (e1 ∧ e2 )(e1 ∧ e2 )
| {z }
−1

(e1 ∧ e2 ) = 1.
See [57] for mathematical details.
The reverse à of a multivector is the multivector with reversed order of the outer
product components; for instance the reverse of 1+e1 ∧e2 is 1+e2 ∧e1 or 1−e1 ∧e2 .
8  The Power of Geometric Algebra Computing

2.2 CONFORMAL GEOMETRIC ALGEBRA (CGA)


Conformal Geometric Algebra is very well suitable to realize engineering applica-
tions. This is primarily because of its easy handling of geometric objects such as
spheres, planes and lines.
Conformal Geometric Algebra uses three Euclidean basis vectors e1 , e2 , e3 and
two additional orthogonal basis vectors e+ , e−

e+ · e− = 0 (2.5)

with positive and negative signatures, respectively, which means that they square to
+1 as usual (e+ ) and to −1 (e− )

e2+ = 1, e2− = −1. (2.6)

Another basis e0 , e∞ , with the geometric meaning where


e0 represents the 3D origin,
e∞ represents infinity,
can be defined by the transformation
1
e0 := (e− − e+ ), e∞ := e− + e+ . (2.7)
2

TABLE 2.3 The 32 basis blades of the 5D Conformal Geometric Algebra (Conformal
Geometric Algebra)

Grade Term Blades No.


0 scalar 1 1
1 basis vectors e1 , e2 , e3 , e∞ , e0 5
e1 ∧ e2 , e1 ∧ e3 , e1 ∧ e∞ ,
2 2-blades e1 ∧ e0 , e2 ∧ e3 , e2 ∧ e∞ , 10
(for bivectors) e2 ∧ e0 , e3 ∧ e∞ , e3 ∧ e0 ,
e∞ ∧ e0
e1 ∧ e2 ∧ e3 , e1 ∧ e2 ∧ e∞ , e1 ∧ e2 ∧ e0 ,
3 3-blades e1 ∧ e3 ∧ e∞ , e1 ∧ e3 ∧ e0 , e1 ∧ e∞ ∧ e0 , 10
(for trivectors) e2 ∧ e3 ∧ e∞ , e2 ∧ e3 ∧ e0 , e2 ∧ e∞ ∧ e0 ,
e3 ∧ e∞ ∧ e0
e1 ∧ e2 ∧ e3 ∧ e∞ ,
e1 ∧ e2 ∧ e3 ∧ e0 ,
4 4-blades e1 ∧ e2 ∧ e∞ ∧ e0 , 5
(for quadvectors) e1 ∧ e3 ∧ e∞ ∧ e0 ,
e2 ∧ e3 ∧ e∞ ∧ e0
5 pseudoscalar e1 ∧ e2 ∧ e3 ∧ e∞ ∧ e0 1

Table 2.3 shows the 32 basis blades of Conformal Geometric Algebra, consist-
ing of the scalar, five (basis) vectors, ten 2-blades, ten 3-blades, five 4-blades and
Geometric Algebras for Engineering  9

the pseudoscalar. A linear combination of k-blades is called a k-vector (or a vector,


bivector, trivector. . . . ). The sum e2 ∧ e3 + e1 ∧ e2 , for instance, is a bivector. A lin-
ear combination of arbitrary blades is called a multivector as for instance the sum
3 + e1 ∧ e2 .

2.2.1 Geometric Objects of Conformal Geometric Algebra


Conformal Geometric Algebra provides a great variety of basic geometric entities to
compute with, namely points, spheres, planes, circles, lines, and point pairs, as listed
in Table 2.4. These entities have two algebraic representations: the IPNS (inner prod-
uct null space) and the OPNS (outer product null space). The IPNS of the algebraic
expression A are all the points X satisfying the equation

A · X = 0. (2.8)

The OPNS of the algebraic expression A are all the points X satisfying the equation

A ∧ X = 0. (2.9)

These representations are duals of each other (a superscript asterisk denotes the
dualization operator). In Table 2.4, the vectors x and n are in bold type to indicate that
they represent 3D entities obtained by linear combinations of the 3D basis vectors
e1 , e2 , and e3 :
x = x1 e1 + x2 e2 + x3 e3 . (2.10)
In the OPNS representation, the outer product ∧ indicates the construction of a geo-
metric object with the help of points Pi that lie on it. A sphere, for instance, is defined
by four points (P1 ∧ P2 ∧ P3 ∧ P4 ) on its surface. In the IPNS representation, the mean-
ing of the outer product is an intersection of geometric entities. A circle, for instance,
is defined by the intersection of two spheres S1 ∧ S2 . In order to compute it according
to Fig. 2.1, you first have to compute the centre points P1 , P2

TABLE 2.4 The two representations (IPNS and OPNS) of conformal geometric en-
tities. They are duals of each other, which is indicated by the asterisk symbol.

Entity IPNS representation OPNS representation


Point P = x + 12 x2 e∞ + e0
Sphere S = P− 12 r2 e∞ S∗ = P1 ∧ P2 ∧ P3 ∧ P4
Plane π = n + de∞ π ∗ = P1 ∧ P2 ∧ P3 ∧ e∞
Circle C = S1 ∧ S2 C∗ = P1 ∧ P2 ∧ P3
Line L = π1 ∧ π2 L∗ = P1 ∧ P2 ∧ e∞
Point pair Pp = S1 ∧ S2 ∧ S3 Pp∗ = P1 ∧ P2
10  The Power of Geometric Algebra Computing

Figure 2.1 The intersection of two spheres results in a circle.

1
P1 = x1 + x1 2 e∞ + e0 ,
2
1
P2 = x2 + x2 2 e∞ + e0 ,
2

based on their 3D representations x1 , x2


x1 = x1,1 e1 + x2,1 e2 + x3,1 e3 (2.11)
and
x2 = x1,2 e1 + x2,2 e2 + x3,2 e3 (2.12)
and then compute the spheres S1 , S2 with these points and the radii r1 and r2
1
S1 = P1 − r12 e∞ ,
2
1
S2 = P2 − r22 e∞ ,
2

and finally compute the circle as the intersection of them using the outer product
Circle = S1 ∧ S2 .

2.2.2 Angles and Distances in 3D


The inner product of geometric objects have the meaning of angles or distances in
Conformal Geometric Algebra according to Table 2.5. Details can be found in the
indicated sections of [29].

2.2.3 3D Transformations
Reflections are the basis of 3D transformations. The reflection of an object o at a
plane P is expressed by
oreflected = PoP. (2.13)
Geometric Algebras for Engineering  11

TABLE 2.5 Geometric Meaning of the Inner Product of Planes, Spheres and Points

· Plane Sphere Point


Plane Angle between planes Euclidean distance Euclidean distance
from centre
[29] Sect 3.4.2 [29] Sect 3.4.1.3 [29] Sect 3.4.1.2
Sphere Euclidean distance Distance measure Distance measure
from centre
[29] Sect 3.4.1.3 [29] Sect 3.4.1.4 [29] Sect 3.4.1.5
Point Euclidean distance Distance measure Distance
[29] Sect 3.4.1.2 [29] Sect 3.4.1.5 [29] Sect 3.4.1.1

Transformations such as rotations and translations are also represented by combina-


tions of reflections. The operator
φ
R = e−( 2 )L (2.14)

describes a rotor. L is the rotation axis, represented by a normalized bivector, and φ


is the rotation angle around this axis. R can also be written as
   
φ φ
R = cos − L sin . (2.15)
2 2

The rotation of a geometric object o is performed with the help of the operation

orotated = RoR̃.

There are strong relations between rotations in Conformal Geometric Algebra and
quaternions and dual quaternions (see [29]).
In Conformal Geometric Algebra, a translation can be expressed in a multiplica-
tive way with the help of a translator T defined by
1
T = e− 2 te∞ , (2.16)

where t is a vector
t = t1 e1 + t2 e2 + t3 e3 .
Application of the Taylor series

1 − 12 te∞ (− 21 te∞ )2 (− 12 te∞ )3


T = e− 2 te∞ = 1 + + + +...
1! 2! 3!
and the property (e∞ )2 = 0 results in the translator

1
T = 1 − te∞ . (2.17)
2
12  The Power of Geometric Algebra Computing

Figure 2.2 Translation of a sphere from the origin to the point Pt .

Let us, for instance, translate the sphere

S = −e∞ + e0 (2.18)

(see Fig. 2.2) in the x-direction by the translation vector

t = 4e1 . (2.19)

Note that this is a sphere with its centre at the origin and with r2 = 2. The translator
in this example has the form
T = 1 − 2e1 e∞ , (2.20)
and its reverse is
T̃ = 1 + 2e1 e∞ . (2.21)
The translated sphere can now be computed as the versor product

Stranslated = T S T̃ (2.22)

= (1 − 2e1 e∞ )(−e∞ + e0 )(1 + 2e1 e∞ )


= (1 − 2e1 e∞ )(−e∞ − 2 e∞ e1 e∞ +e0 + 2e0 e1 e∞ )
| {z }
0

= (1 − 2e1 e∞ )(−e∞ + e0 − 2e1 e0 e∞ )


= −e∞ + e0 − 2e1 e0 e∞ + 2e1 e∞ e∞ −2e1 e∞ e0 + 4e1 e∞ e1 e0 e∞
| {z }
0

= −e∞ + e0 − 2e1 (e0 e∞ + e∞ e0 ) + 4e1 e∞ e1 e0 e∞


| {z }
−2

= 4e1 − e∞ + e0 + 4 e1 e∞ e1 e0 e∞
| {z }
−e∞
Geometric Algebras for Engineering  13

= 4e1 − e∞ + e0 − 4e∞ e0 e∞
|{z}
e0 ∧e∞ −1

= 4e1 − e∞ + e0 − 4 e∞ (e0 ∧ e∞ ) +4e∞ ,


| {z }
−e∞

resulting in
Stranslated = 4e1 + 7e∞ + e0 . (2.23)
This is a sphere with the same radius r2 = 2, but with a translated centre point
1
Pt = t + t2 e∞ + e0 = 4e1 + 8e∞ + e0 . (2.24)
2
Please notice that in 3D a rigid body motion is still more general in the sense that
it consists of a rotation around an arbitrary line in space together with a translation
in the direction of this line. Please refer to Chapt. 8 for an application of a robot
kinematics using these transformations. For more details about Conformal Geometric
Algebra see [29].

2.3 COMPASS RULER ALGEBRA (CRA)


Compass Ruler Algebra [30] is simply the Conformal Geometric Algebra in 2D. This
4D Geometric Algebra3 is represented by multivectors with 16 coordinates, namely
combinations of the four basis vectors (e1 , e2 , e0 , e∞ ).
As follows, we will see how
- geometric objects and their intersections
- angles and distances between geometric objects
- transformations of geometric objects
can be expressed easily with the help of algebraic expressions.

2.3.1 Geometric Objects


Table 2.7 shows a list of the basic geometric objects of the Compass Ruler Algebra,
namely points, circles, lines and point pairs.
These entities have two algebraic representations, the IPNS and the OPNS rep-
resentation. These representations are duals of each other (a superscript asterisk de-
notes the dualization operator). A 2D point with coefficients x1 , x2 and basis vectors
e1 , e2
x = x1 e1 + x2 e2 (2.25)
is embedded in the 4D Compass Ruler Algebra as point
1
P = x + x2 e∞ + e0 (2.26)
2
3 4D relates to the number of four basis vectors
14  The Power of Geometric Algebra Computing

TABLE 2.6 The 16 Basis Blades of the Compass Ruler Algebra (to be identified by
their indices)

Index Blade
0 1
1 e1
2 e2
3 e∞
4 e0
5 e1 ∧ e2
6 e1 ∧ e∞
7 e1 ∧ e0
8 e2 ∧ e∞
9 e2 ∧ e0
10 e∞ ∧ e0
11 e1 ∧ e2 ∧ e∞
12 e1 ∧ e2 ∧ e0
13 e1 ∧ e∞ ∧ e0
14 e2 ∧ e∞ ∧ e0
15 e1 ∧ e2 ∧ e∞ ∧ e0

with the two additional basis vectors e∞ , e0 (with the geometric meaning of infinity
and origin) and
x2 = x12 + x22 (2.27)
being the scalar product of x.
x and n in Table 2.7 are in bold type to indicate that they represent 2D entities
obtained by linear combinations of the 2D basis vectors e1 and e2 . L represents a
line with normal vector n and distance d to the origin. The {Ci} represents different
circles. The outer product “∧” indicates the construction of a geometric object with
the help of points {Pi } that lie on it. A circle, for instance, is defined by three points
(P1 ∧ P2 ∧ P3 ) on this circle. Another meaning of the outer product is the intersection
of geometric entities. A point pair is defined by the intersection of two circles C1 ∧C2 .
The following example shows how, in Compass Ruler Algebra, we are able to
compute comparable to working with compass and ruler. In order to construct the
perpendicular bisector of a section of a line with compass and ruler, we draw two
circles with the centre at the boundary points and connect the two intersection points
according to Fig. 2.3.
Geometric Algebras for Engineering  15

TABLE 2.7 The Representations of the Geometric Objects of the Compass Ruler
Algebra

Entity IPNS representation OPNS representation


Point P = x + 12 x2 e∞ + e0
Circle C = P − 12 r2 e∞ C∗ = P1 ∧ P2 ∧ P3
Line L = n + de∞ L∗ = P1 ∧ P2 ∧ e∞
Point pair Pp = C1 ∧C2 Pp∗ = P1 ∧ P2

Figure 2.3 Vis2d Visualization of the perpendicular bisector between the two (red)
points.

At first we have to compute the circles based on the centre points P1 , P2 and the
radii r1 , r2 4
1
S1 = P1 − r12 e∞ ,
2
1
S2 = P2 − r22 e∞ ,
2

and then compute the intersection of them


PP = S1 ∧ S2
based on the outer product. The bisector is then the line through the two points of the
resulting point pair
L = (PP∗ ∧ e∞ )∗
4 Please notice that the first part of the algorithm is completely the same as for spheres in 3D according

to the algorithm of Sect. 2.2.1


16  The Power of Geometric Algebra Computing

Sect. 3.2.3 shows how to describe this algorithm in GAALOP and Sect. 4.3.1
how to visualize it. Please refer to Sect. 5.2 for some runtime considerations based
on this example.

2.3.2 Angles and Distances


The inner product of these geometric objects describes distances and angles between
them as summarized in Table 2.8.

TABLE 2.8 Geometric Meaning of the Inner Product of Lines, Circles and Points

A·B B Line B Circle B Point


A Line Angle between lines Euclidean distance Euclidean distance
from centre
[30] Eq. (7.9) [30] Eq. (7.13) [30] Eq. (7.6)
A Circle Euclidean distance Distance measure Distance measure
from centre
[30] Eq. (7.13) [30] Fig. 7.7 [30] Eq. (7.16)
A Point Euclidean distance Distance measure Distance
[30] Eq. (7.6) [30] Eq. (7.16) [30] Eq. (7.3)

The inner product L1 · L2 of two lines L1 and L2 , for instance, describes the an-
gle between these lines, while the inner product between other geometric objects
describes the Euclidean distance or some kind of distance measure between them.
Please refer to [30] and the indicated equations and figures for more details.

2.3.3 Transformations
Transformations of a geometric object o can be easily described within Compass
Ruler Algebra according to Table 2.9. The reflection, for instance, of a circle C at a
line L can be computed based on the (geometric) product −LCL (please remember
that the geometric product in Geometric Algebra is written without a specific product
symbol). Rotations or translations can be described based on algebraic expressions

TABLE 2.9 The Description of Transformations of a Geometric Object o in Compass


Ruler Algebra (please note that LoL means the geometric product of L, o and L)

Transformation Operator Usage


Reflection L = n + de∞ o = −LoL
    L
φ φ
Rotation R = cos 2 − e1 ∧ e2 sin 2 oR = RoR̃
Translation T = 1 − 12 te∞ oT = ToT̃
Geometric Algebras for Engineering  17

called rotors R and translators T . Using the rotor


   
φ φ
R = cos − e1 ∧ e2 sin , (2.28)
2 2

the rotated object oR can be computed based on the geometric product RoR̃

oR = RoR̃ (2.29)

with R̃ being the reverse of R (see Sect. 2.1). A translated object oT can be computed
based on the translator
1
T = 1 − te∞ (2.30)
2
with t being the 2D translation vector t1 e1 + t2 e2 as

oT = ToT̃ . (2.31)

Please refer to [30] for more details.

2.4 PROJECTIVE GEOMETRIC ALGEBRA (PGA) WITH GANJA


The Projective Geometric Algebra (PGA) has been introduced to a wider computer
graphics community at the Siggraph conference 2019 by Charles Gunn and Steven de
Keninck. Ganja [14] is a javascript-based package for the web, developed by Steven
de Keninck. It allows the computation of Geometric Algebra algorithms, which are
written in javascript, and provides also a visualization of the Geometric Algebra al-
gorithms. The Ganja Coffeeshop [15] is equipped with some examples of PGA visu-
alizations using Ganja[14].

2.4.1 2D PGA
PGA is presented on some cheat sheets [13] at www.bivector.net. Figure 2.4 shows
some basics of 2D PGA. It is a Geometric Algebra with signature (2,0,1) means there
are two basis vectors squaring to 1, none squaring to −1 and one squaring to 0. The
three basis vectors are the vectors e0 squaring to 0 and the basis vectors e1 and e2
squaring to 1. Additionally, 2D PGA consists of the scalar, the three bivectors e01 ,
e20 and e12 and the pseudoscalar e012 . Because of e0 squaring to 0, the multiplication
table of these basis blades consists of many zero values.
Figure 2.5 presents some geometry basics of 2D PGA. The Euclidean point (x,y)
is computed as a bivector sum and a line as a vector sum. There are also some inci-
dence, reject and project operations shown. Meeting of two geometric objects means
intersecting them and joining of two points, for instance, means constructing a line
based on these points.
Listing 2.1 shows a simple Ganja script from the Ganja Coffeeshop. It computes
with points and lines by creating, joining and intersecting them. The result is shown
in Fig. 2.6.
18  The Power of Geometric Algebra Computing

Figure 2.4 The basics of the 2D Projective Geometric Algebra according to [13].

Listing 2.1: simple Ganja script according to [15].


1 Algebra (2 ,0 ,1 ,()= >{
2
3 var point = (x , y )= >1 e12 - x *1 e02 + y *1 e01 ;
4 var line = (a ,b , c )= > a *1 e1 + b *1 e2 + c *1 e0 ;
5
6 var A = point ( -1 ,1) , B = point ( -1 , -1) , C = point (1 , -1);
7 var L = line ( -1 ,1 ,0.5)
8 var M =()= > C & A ;
9 var D =()= > L ^ M ;
10
11 document . body . appendChild ( this . graph ([
12 A, "A", // Render point A and label it .
13 B, "B", // Render point B and label it .
14 C, "C", // Render point C and label them .
15 L , " L " , M , " M " , // Render and label lines .
16 D, "D", // I n t e r s e c t i o n point of L and M
17 0 xff0000 , // Set the color to red .
18 [B , C ] , // Render line segment from B to C .
19 0 xffcccc , // Set the color to light red .
20 [A ,B , C ] // render polygon ABC .
21 ] ,{ grid : true }));
22 });
Geometric Algebras for Engineering  19

Figure 2.5 Geometry basics of the 2D Projective Geometric Algebra according to


[13].

First, we create a Geometric Algebra with 2,0,1 metric, means two basis vectors
are squaring to 1 and one basis vector squaring to 0. We define our points to be bivec-
tors5 . For readability we create a function that converts 2D Euclidean coordinates to
their bivector representation. Similarly, we can define lines directly. The Euclidean
line ax + by + c can be specified as a*1e1+b*1e2+c*1e06 .
We then define the 3 points A, B and C. They are based on their 2D coordinates
but draggable in the visualization. The line L is defined according to the equation
y = x − 0.5. A line can also be defined by joining7 two points. We define M as a
function so it will update when C or A are dragged. Points can also be found by
intersecting (meeting) two lines. We similarly define D as a function for interactive
updates. Finally, we use the graph function to create the visualization of our alge-
braic elements (see Fig. 2.6). The graph function accepts an array of items that it
will render in order. It can render points, lines, labels, colours, line segments and
polygons.

2.4.2 3D PGA
3D PGA is also described by a cheat sheet [13] at www.bivector.net. It is a natural
extension of 2D PGA as can be seen on Fig. 2.7 with the geometry basics of 3D
PGA.
5 please take notice of the minus sign of x because of the anti-commutativity of the outer product
6 inGanja, the basis vectors or basis blades are written with a number 1 in front
7 Please refer to the definition in Fig. 2.4
20  The Power of Geometric Algebra Computing

Figure 2.6 Visualization of the Listing 2.1.

The following example of the Ganja Coffeeshop according to Listing 2.2 handles
transformations as motion interpolations between geometric objects.

Listing 2.2: Ganja script for 3D transformations according to [15].


1 // Create a G e o m e t r i c Algebra with 3 ,0 ,1 metric .
2 Algebra (3 ,0 ,1 ,()= >{
3
4 // The g e o m e t r i c e l e m e n t s of 3 D PGA .
5 // Grade -1 ele men t s ( r e f l e c t i o n s ) r e p r e s e n t planes .
6 // Grade -2 ele men t s ( b i r e f l e c t i o n s or line r e f l e c t i o n s )
7 // r e p r e s e n t lines .
8 // Grade -3 ele men t s ( t r i r e f l e c t i o n s or point r e f l e c t i o n s )
9 // r e p r e s e n t points .
10 var plane = (a ,b ,c , d )
11 = >( a *1 e1 + b *1 e2 + c *1 e3 + d *1 e0 ). Normalized ,
12 line = (... plucker )
13 = >( plucker *[1 e01 ,1 e02 ,1 e03 ,1 e12 ,1 e13 ,1 e23 ]). Normalized ,
14 point = (x ,y , z )= >!(1 e0 + x *1 e1 + y *1 e2 + z *1 e3 );
15
16 // T r a n s f o r m a t i o n s in PGA are r e p r e s e n t e d by versors ,
17 // which are c o m p o s i t i o n s ( g e o m e t r i c product )
Another random document with
no related content on Scribd:
to her she said to them: “Here Namakaokahai ia lakou: “Eia o
are Hinawaikoli, the feathers Hinawaikolii, na hulu i ka lae o
from the forehead of Halulu, who Halulu, ua make, ua pepehi ia.”
is dead. He has been killed.” A lohe na kaikunane, olelo aku
When the brothers heard this, la ia Namakaokahai: “Ua pono
they said to Namakaokahai: “It is no ia ke make, no ka mea, he
quite right that the bird should be hana ino kana, he ai i ke
killed, because he is an evil kanaka.”
thing, he eats men.”

After the bird was killed, Ma keia make ana o ua manu


Aukelenuiaiku and the men cut it nei ia Aukelenuiaiku, okioki iho
up and roasted some of the meat la lakou i ka io, a koala aku la i
on the coals, and after the meat luna o ke ahi, a ai iho la lakou.
was cooked they sat down and Mahope o laila, imi iho la lakou i
had their meal. After their meal alanui e hoi ai i lalo nei, aka, e
was finished, they began to noho ana ia wa, ko Halulu lua,
study how to get down from the he manu no, o Kiwaha ka inoa.
cliff. At this time there was Haawi mai la ia ia Aukelenuiaiku
another bird in the cave, the i alanui. Oia ke anuenue
mate of Halulu, by the name of poomuku, ekolu ano, he
Kiwaha. This bird gave lenalena, he ula, he omaomao.
Aukelenuiaiku the means of A malaila lakou i hoi ai a hiki i
getting down the cliff, by giving lalo.
him a short-ended rainbow, 18
one with only three colors, Ma keia mau hana o pau a
yellow, red and green. By means Aukelenuiaiku, ua mahalo na
of this rainbow they reached the kanaka eha ia ia, no kona
bottom of the cliff. In thus getting malama ana ia lakou i loko o ka
away successfully, the four men make, a me ke alanui kahi o
were thankful to Aukelenuiaiku, lakou i hoi ai i lalo, a ua aloha
for they knew that they were lakou ia ia.
rescued from a terrible death,
and so they were very grateful
for the kindness shown them.

the return of ka hoi ana o


aukelenuiaiku to the aukelenuiaiku i lalo,
bottom with the men. me na kanaka.

When Aukelenuiaiku and the A hiki o Aukelenuiaiku i lalo me


men reached the bottom [of the na kanaka, lawe ae la o Kiwaha i
cliff], Kiwaha again took up the ke alanui anuenue i ka pali,
rainbow and placed it on the cliff. mahope o laila, ninau aku o
After this Aukelenuiaiku asked Aukelenuiaiku i na kanaka:
the men: “What do you want?” “Heaha ka oukou mau mea
They each answered: “I want a ono?” I mai lakou: “He ko ka’u,
piece of sugar-cane.” “I want a he uwala ka’u, he maia ka’u, he
potato.” “I want a banana.” “I kalo ka’u.” Olelo aku o
want a taro.” Aukelenuiaiku then Aukelenuiaiku ia lakou: “He kapu
said to them: “The sugar-cane is ke ko na kuu keiki, ina e ai, o
kapued for my son. If any one kona manawa ia e make ai, pela
eats it he will die. So are the ka uala, ka maia, ke kalo,
potatoes, the bananas and the nolaila, mai noho oukou a lalau i
taro. So I will advise each of you keia mau mea a pau loa ke hele
not to touch these things as we kakou ma ke alanui, o make
go on our way, else you will all oukou.” A pau ke ao ana o
die.” After giving them this Aukelenuiaiku ia lakou, alaila,
advice they all started out. On hele aku la lakou. Ma keia hele
the way, however, the men did ana aole lakou i malama i na
not adhere to the advice given olelo a Aukelenuiaiku. O ke
them by Aukelenuiaiku, for he kanaka puni ko, lalau aku la ia i
who wanted the sugar-cane took ka puna o ke ko, a make iho la
a piece and ate it, so he died; ia; pela lakou a pau loa eha, ua
the other three men also took up make lakou, mamuli o ka lakou
the things they craved for and mau mea i ono ai, a papale i na
they also died. Thus did the four olelo ao a Aukelenuiaiku.
men die, for not keeping the
advice given them by
Aukelenuiaiku.

After the death of the four men, A pau lakou i ka lilo i ka make,
Aukelenuiaiku continued on by koe iho la o Aukelenuiaiku, hoi
himself until he reached the aku la ia a hiki i ka hale, ike mai
house. When the wife and the la ka wahine me na kaikoeke,
brothers-in-law saw uwe mai la, a halawai ae la
Aukelenuiaiku, they all wept for lakou me ka oluolu aloha.
joy and he was welcomed home. Mahope o keia halawai ana,
After this, Aukelenuiaiku and his noho pu iho la laua, he kane a
wife lived on happily, each he wahine, ma keia noho ana ua
determined to love each other uhi ia ko laua mau manao i ke
more and more. The wife [68]had aloha a me ke manao, a hala ka
no other thoughts but of the wa loihi [69]o keia noho ana. Ua
comfort of her husband. They uhi ia ka manao o ke ’lii wahine
continued living this way for no kana kane, a ua pau kona
some time. Because of this great manao maluna o Aukelenuiaiku.
love for her husband, Nolaila, haawi mai la o
Namakaokahai gave over the Namakaokahai, kana wahine i
kingdom to her husband, as well ka ea o ka aina, a me na mea a
as everything else at her pau loa i loko o ko Aukelenuiaiku
command; and she even gave lima, a me kona mau kino ano
him the command and the use of akua kekahi.
her supernatural bodies.

One day when Aukelenuiaiku I kekahi la, komo aku la o


entered the eating house, to Aukelenuiaiku i loko o ka hale e
have something to eat, while so ai ai, ia ia e ai ana’ wehe malu
doing, Namakaokahai secretly ae la o Namakaokahai i ka pahu
opened the box containing the o ke ’kua o Aukelenuiaiku, a
god of Aukelenuiaiku. Looking in nana iho la i loko, e waiho ana
she saw the axe and the knife. ke koi a me ka pahi i loko, lalau
She then took up the axe and iho la ia ma ka oi o ke koi a
ran her fingers over the edge, hamo iho la, moku ae la ka lima,
cutting her fingers so they bled. a kahe ke koko, nolaila, pane iho
Namakaokahai then said: “How la o Namakaokahai: “Kupanaha!
strange! here my husband has he mea maikai no ka hoi ka kuu
some very good things which he kane e huna nei;” a pau kona
is hiding from me!” After looking nana ana, huna iho la ia. A pau
over these things she closed the ka ai ana o Aukelenuiaiku, hoi
box and put it away. When mai la ia a noho. Hoomaoe aku
Aukelenuiaiku finished his meal la o Namakaokahai iaia: “Ea!
he returned and sat down. heaha kau mau mea maikai o ka
Namakaokahai then asked him, hele ana mai?” Lalau iho la o
pretending not to have seen Aukelenuiaiku i ka pahu a wehe
what was in the box, saying: ae la, lalau iho la i ke koi a me
“Say, what useful things did you ka pahi, a haawi aku la ia
bring with you when you came?” Namakaokahai, me ka olelo aku:
Aukelenuiaiku then picked up the “O keia mau mea elua, na mea
box and opening it, he took out maikai a’u i lawe mai ai mai ka
the axe and knife and gave them aina o Kuaihelani mai, a oia mau
over to his wife, saying: “These mea elua a me kuu akua, akolu
two things which I have brought mea maikai loa.” Ninau mai kana
with me from the land of wahine: “Heaha ka waiwai a me
Kuaihelani are very good and ka hana a keia mau mea?” “He
useful. These two things oki i ka laau a moku, a pela ka
together with my god are the pahi, he mea okioki no na mea
three things of the greatest uaua a pau loa.” A lohe o
value.” The wife then asked him: Namakaokahai i keia mau olelo
“What are these things good a Aukelenuiaiku, olelo aku la ia i
for?” “The axe will cut a log of kana kane: “E! o kau mea
wood in two. The knife is also
useful, for it can cut any tough maikai, o ka’u mea maikai, hooili
thing you have.” When na ka kaua keiki.”
Namakaokahai heard this she
said to her husband: “Say, your
valuable things together with
mine we will leave with our
child.”

Further on in our story we will Ma keia wahi aku, e ike kakou i


see the supernatural powers of ka mana o Namakaokahai, a me
Namakaokahai, and how it was kona make ole i nei mea oi o ke
impossible to kill her, although koi, a e maopopo no auanei ia
she was cut up with the axe; by kakou he ano aku no kona. A
which acts we will know that she pau ko laua kamailio ana no ke
was not human. After talking koi a me ka pahi, olelo aku o
about the axe and knife, Namakaokahai i kana kane ia
Namakaokahai said to her Aukelenuiaiku: “E oki mai oe ia’u
husband: “You proceed and cut i ke koi.” I aku o Aukelenuiaiku:
me into pieces with the axe.” “Kupanaha oe! o oe no ka’u
Aukelenuiaiku said: “How wahine ponoi, a pehea la wau e
strange of you to ask me to do ooki aku ai ia oe, a make iho; e
such a thing as to cut you up, my aho, i ke kanaka e au e ooki ai i
own wife! How can I do such a ke koi a moku, a i ole ia he hoa
thing, for it will mean your death? hakaka, aole o oe o ko’u io
Rather let me cut up some other ponoi.” I mai ka wahine:
person with this axe, or my “Kahaha! e haawi hoi paha
opponent in some fight, not you, auanei oe i ke koi ia hai, lilo hoi
my own flesh.” The wife replied: ka mea maikai a ka kaua keiki,
“You might give this axe to nolaila, e hoao mai no oe ia’u.” A
someone else and thus deprive no ko Namakaokahai paakiki
our child of such a useful thing. loa, ae aku kana kane; ma keia
Therefore I want you to try it on ae ana o kana kane, ua lilo ia i
me.” And because mea oluolu loa ia
Namakaokahai insisted on it, the Namakaokahai. Mahope o keia
husband finally gave in, whereat ae ana o Aukelenuiaiku e ooki
she was much pleased. When aku ia Namakaokahai i ke koi,
this consent was given hoolei loa aku la na wawae o
Namakaokahai stretched out her Namakaokahai a pololei, ooki
legs and Aukelenuiaiku severed iho la o Aukelenuiaiku i ke koi.
them with the axe.

CHAPTER IX. MOKUNA IX.

How Aukelenuiaiku and Ka hoike ana o na


Namakaokahai Showed Waiwai a Aukelenuiaiku
Their Useful Things. me ka Namakaokahai.

In the preceding chapter of this Ua olelo ia ma ka mokuna mua


story we were told of the axe and iho o keia moolelo, o ke koi, a
the knife, the two useful things me ka pahi, ka Aukelenuiaiku
belonging to Aukelenuiaiku. In mau waiwai, a ma keia kakau
this chapter we will speak of the ana, e olelo ia ana ke oki ana o
cutting up of Namakaokahai by Aukelenuiaiku i kana wahine i ke
Aukelenuiaiku by the use of the koi. Ia Aukelenuiaiku i ooki ai ia
axe. When Aukelenuiaiku began Namakaokahai i ke [71]koi, moku
to cut up Namakaokahai with the ae la kona mau wawae a
axe, the feet were the first kaawale loa, a ma keia moku
[70]things that were cut off, and ana o kona mau wawae, he mea
as this was done, Namakaokahai lealea iho la ia i ko
expressed great joy, for it was Namakaokahai manao. I aku o
fun to her. Namakaokahai then Namakaokahai ia Aukelenuiaiku:
said to Aukelenuiaiku: “Yes, you “U! akahi ka ka mea maikai nui
have a very useful thing indeed; wale au, e oki hou mai ana oe”;
cut off another portion.” When a lohe o Aukelenuiaiku, ooki aku
Aukelenuiaiku heard this he la ia i ke koi, a moku na oloolo
proceeded and cut off the calves wawae, pela no ka
of the legs, and this cutting was Aukelenuiaiku ooki ana a hiki i
kept on until the head was also ke poo. Mahope o keia okioki
cut off from the body. In this ana, ua kaawale loa kela wahi
cutting, the several portions of keia wahi o ke kino o
the body of Namakaokahai were Namakaokahai, aka, aole nae he
completely severed and pau o ka olelo ma kona waha.
separated from each other, but
the mouth never ceased
speaking.

After the body of Namakaokahai A pau loa ke kino o


had been cut up into several Namakaokahai i ka moku i ke koi
pieces, the head asked of a Aukelenuiaiku, ninau ae la ke
Aukelenuiaiku: “Are these all the poo o Namakaokahai ia
useful things my husband Aukelenuiaiku: “Ea! pau ae la
brought with him?” “Yes, these kau mea maikai e ke kane?” “Ae,
are all; and I am surprised at ua pau loa ae la, no ka mea, a
you, for when a person is cut up moku keia mea he kanaka, he
in this manner, death is certain.” make kona hope.” Mahope o
Namakaokahai then replied: “If keia olelo a Aukelenuiaiku, pane
these are all the useful things mai o Namakaokahai: “Ae, pau
you have, I will now show you ae la kau mea maikai, o ka’u
what I have.” Saying this, the mea maikai koe.” Ma keia olelo a
pieces began to get together of Namakaokahai, hoi ae la kona
their own accord, and in a short kino a hui ma kahi mua, pela na
space of time the body was wahi a pau loa i kaawale, a ola
again complete and restored as ae la ia e like me mamua.
before. She then called for her Kahea aku la ia i kona mau
four brothers, Kaneapua, kaikunane eha, oia o Kaneapua,
Kanemoe, Leapua and Kanemoe, Leapua, Kahaumana.
Kahaumana. Upon their arrival A hiki mai la na kaikunane i mua
the sister asked them: “What o ko lakou kaikuahine, o
shall I change myself into? Shall Namakaokahai, i aku la ia: “E
it be into a cliff?” Her brothers aha la wau, e pali paha wau?”
then answered: “Yes, change Ae aku la na kaikunane, “ae, e
yourself into a cliff.” At that very pali oe.” Ia wa, ku ana ua pali,
moment a great, high cliff stood lele koae, laumania, nanao,
before them, smooth and straight nihinihi; hamo ae la o
up and down, where the koae 19 Aukelenuiaiku me ka makau a
was seen flying. Aukelenuiaiku me ka hopohopo. Alaila, oili ae
looked at it and touched its la o Namakaokahai a ku ana
smooth sides with his hands with maluna o ka welau o ka pali, a
fear and great excitement. He nana iho i ke kane me ka ninau
next saw Namakaokahai, his iho: “E aha ana oe?” I aku ke
wife, standing on the very top of kane: “E mahalo iho ana au, o
the cliff; then he saw her looking kau mea maikai, o ka’u mea
down at him, and she called: maikai, na ka kaua keiki ia.” Ma
“What are you doing?” The keia olelo a Aukelenuiaiku, he
husband replied: “I am admiring kanaaho wale ae no, he makau
your supernatural powers. Your kona e noho ana.
useful things together with mine
will be a great inheritance for our
child.” In making this reply,
Aukelenuiaiku made believe that
he was not afraid; but in fact he
was almost overcome with fear.

While Namakaokahai was Ia Namakaokahai e ku ana i luna


standing there on the cliff, she o ka pali, kahea iho la i na
called out to her four brothers kaikunane ona eha: “E aha la
and said: “What shall I change wau, e kai paha?” Ae aku na
myself into now? Shall it be into kaikunane, “ae, e kai oe.” Lilo ae
an ocean?” The brothers replied: la ka aina i kai, he nalu ma na
“Yes, change yourself into a vast wahi a pau loa, aohe wahi
ocean.” At that very moment the kaawale i koe, a o
whole cliff dissolved and turned Aukelenuiaiku, i loko o ka
into a great ocean, with its manawa e poi nei ka nalu, oili ae
surface covered with mighty la o Namakaokahai, a ninau mai
waves, so completely that la i ke kane: “E Aukelenuiaiku, e
nothing else could be seen. aha ana oe?” I aku ke kane: “E
Aukelenuiaiku was at this time mahalo ae ana au i keia mea
being engulfed by the water and maikai au.”
he was sore afraid, but at the
appearance of Namakaokahai
and questioned by her, “What
are you doing?” he replied: “I am
admiring your great powers.”

After the ocean, Namakaokahai A mahope o ke kai, kuu iho la o


changed herself into a terrible Namakaokahai i ke kino ahi ona,
fire and the land was enveloped pau ae la ka aina i ke ahi a puni,
in flame, covering the whole aohe wahi i koe. A o ke kane hoi
surface as far as the eye could o Aukelenuiaiku, aia i loko o ka
see. Aukelenuiaiku was entirely lapalapa o ke ahi kahi i noho ai.
surrounded by the fire, in the Alaila, ninau iho ka wahine: “E
midst of which he saw his wife aha ana oe e Aukelenuiaiku?” “E
and heard her asking him, mahalo ae ana au i keia mea
saying: “What are you doing, maikai au o ke ahi.” [73]
Aukelenuiaiku?” He replied: “I
am still admiring your great
powers and the fire.” [72]

These three things, the cliff, the O keia mau mea ekolu, o ka pali,
ocean and the fire were the three o ke kai, o ke ahi he mau kino
supernatural bodies of lakou no Namakaokahai, ma
Namakaokahai, and she gave to kona ano akua, koe nae ke kino
her husband the power to lele ona, ua haawi aku ia i kana
change himself into these three kane. A o ke kino lele o
different things. She, however, Namakaokahai, ua aua ia i kana
did not reveal her fourth form kane, aole i haawi aku, no kona
and power, the power to fly manao, o lele auanei, nele ia i ke
through space. The reason why kane ole, nolaila, aua ia. Aka, o
she did not reveal this fourth na kaikunane ona, ua manao
power to her husband and did lakou e hoike malu i ko lakou
not wish him to possess it, was kaikoeke ia kino.
because she was afraid that he
might take it into his mind to fly
away and deprive her of him, so
she thought she would keep this
power to herself. 20 The brothers,
however, did not approve of this,
and decided to teach their
brother-in-law secretly how to
acquire this power. 21

CHAPTER X. MOKUNA X.

How the Brothers-in- No ka Haawi Malu ana


law of Aukelenuiaiku o na Kaikoeke o
Secretly Taught Him Aukelenuiaiku, Iaia i ke
to Fly. Kino Lele.
We will here see how the four Maanei, e hoolohe kakou i na
brothers-in-law of Aukelenuiaiku olelo ninau a na kaikoeke o
gave him the power to fly, in Aukelenuiaiku eha, a e nana
payment for the offerings made kakou i ko lakou aloha i ko lakou
by him to the gods. Some time kaikoeke, a e hoomanao iho i na
after this his brothers-in-law said olelo mua i hala, penei: “I keia la
to him: “Today you will realize e ike ai oe i ka pono o ke ’kua.”
the blessings of the deity.” After Ninau mai la na kaikoeke o
a while he was asked: “Say, has Aukelenuiaiku: “Ea! ua haawi
your wife given you the power to mai anei ko wahine ia oe i na
change yourself into different kino ona a pau loa?” “Ae,” pela o
forms?” Aukelenuiaiku replied: Aukelenuiaiku. “Na kino hea ka
“Yes.” “What different forms did mea a ko wahine i haawi mai ai
she give you?” “The power to ia oe?” “O ke kino pali, o ke kino
change into a cliff, into an ocean, kai, o ke kino ahi.” I aku na
and into fire.” The brothers-in- kaikoeke: “Aole i pau loa mai la
law replied: “Then she has not na kino o ko wahine, koe aku la
given you all her powers. She ke kino lele ia oe.” “Ae, ua aua
has kept to herself the power to kuu wahine ia mea, aole i haawi
fly.” “Yes, my wife has reserved mai ia’u.” I aku na kaikoeke: “No
that; she did not give it to me.” ka manao o ko wahine, o lele loa
The brothers-in-law continued, oe a nalowale, aole e hoi hou
saying: “It is because your wife mai, nolaila, aua kela.” Mahope
thought you might fly off and o keia mau olelo i aku na
never come back again. That is kaikoeke: “E ao kakou ia oe, i ke
the reason why she has kept this kino lele o ko wahine, i ike oe,
power from you.” After this the eia nae, mai olelo oe i ko
brothers-in-law said to wahine.”
Aukelenuiaiku: “Let us teach you
how to get this flying power of
your wife, so that you may be
able to possess it. But you must
not tell your wife of this.”

That night, after Namakaokahai I ka po, moe iho la o


had retired to their sleeping Namakaokahai i ko laua wahi, o
house, Aukelenuiaiku and his Aukelenuiaiku hoi a me na
brothers-in-law went into another kaikoeke he hale e aku, a ma ia
house and there he was given hale, ma laila lakou i ao ai ia
his lessons in the art of flying. Aukelenuiaiku i ka lele. I aku
They first taught him how to lakou ia Aukelenuiaiku: “E lele
jump and how to fly to certain oe a luna o ka ipu kau;” lele ae
places; then they asked him to la o Aukelenuiaiku a kau ana i
jump to the top of a shelf. After luna o ka ipu. “E lele hou oe a
he was successful in this he was kau i luna o ka lohelau o ka
requested to jump to the top roof hale.” Lele ae la no o
batten of the house. Aukelenuiaiku a kau ana i luna o
Aukelenuiaiku then jumped and laila, a mai laila iho, haule hou
held it for a while, then fell to the ana i lalo.
floor. In this falling,
Namakaokahai heard it, and she Ma keia haule ana o
got up and came to her brothers’ Aukelenuiaiku, ua lohe o
house, and asked them: “What Namakaokahai, ala mai la a kahi
are you doing?” “We are learning a na kaikunane e ao ana ia
how to box.” “What is that?” “It is Aukelenuiaiku, ninau mai la: “E
played this way. Kanemoe aha ana oukou?” “E kui ana
stands up like this on this side, makou.” “Pehea ia mea?”
and Kaneapua stands up on that “Penei: O Kanemoe ma o mai e
side; then they strike at each ku ai kui mai, a o Kaneapua
other, and the one who gets hit maanei aku e kui ai, a hina iho
real hard falls to the floor. That nei o Kaneapua, oia ka halulu au
was the noise you heard.” When i lohe aku la.” A lohe o
Namakaokahai heard this she Namakaokahai, i mai la ia: “U!
said: “I see that my husband has Eia no ka hoi he mea maikai aku
some good thing hidden that he no koe a kuu kane, o ka huna
has not shown me. How mai nei ka ia ia’u, aohe hai mai;
mysterious you are!” After this hoehaa no hoi oe e ke kane la.”
Namakaokahai returned to her Mahope o laila, hoi aku la o
own house. After she Namakaokahai i ko laua hale e
disappeared, Aukelenuiaiku moe ai. A hoi keia, lele hou ae la
again made another attempt to o Aukelenuiaiku i luna o ka
reach the top batten, but again lohelau aohe kau, haule iho la i
he was unsuccessful and he fell lalo, [75]pahu ana, lohe hou o
to the floor. [74]Namakaokahai Namakaokahai i ka halulu, hele
again heard this and she came mai la ia a hiki, olelo mai la i na
to her brothers’ house and asked kaikunane: “E o’u poe
them: “I believe you are teaching kaikunane, e ao ana paha oukou
my husband how to fly.” “No, we i kuu kane i ka lele i luna?”
are wrestling.” “How is that “Aole, e hakoko ana makou.”
done?” “One stands up on this “Pehea ia mea?” “Penei: Ma o
side, and one on the other side; mai kekahi maanei aku kekahi
they then take ahold of one apo na lima, alaila kulai, a o ka
another and each tries to throw mea e hina ana, oia ka halulu au
the other down. The one who is e lohe la.”
thrown down made the noise you
heard.” Because of this Ma keia mau olelo hoi aku la no
satisfactory reply Namakaokahai o Namakaokahai moe i ko laua
again retired to their house. After hale. Lele hou ae la o
she was gone, Aukelenuiaiku Aukelenuiaiku, maloko ae o ka
again made another attempt and hale, a hoea maluna o kaupoku,
this time he was successful. He a puka i waho o ka hale. Ma keia
next came out and flew to the puka ana, lele no o
top of the house, and in this he Aukelenuiaiku a nalowale i ka
was again successful. From the lewa kiekie loa, aole hiki i na
roof Aukelenuiaiku flew up into kaikoeke ke ike ae. Mahope o
the sky, and he went so high that keia lele ana, hoi iho la o
his brothers-in-law were unable Aukelenuiaiku, a hiki i lalo, i aku
to see him. After a while na kaikoeke, “ua ike oe i ka lele.”
Aukelenuiaiku returned to the A loaa ke kino lele ia
ground and his brothers-in-law Aukelenuiaiku, aohe mea i koe
said to him: “Yes, you know how me kana wahine me
to fly now.” Namakaokahai, ua pau loa i ke
kane.

When Aukelenuiaiku found that Ia laua e noho pu ana, he kane a


he was able to fly he was then in he wahine, ua aaki ke aloha me
possession of all the powers ka hoopaa i ko laua mau kino, a
held by his wife. After this the ua akaka loa ka hapai keiki o
two lived on in peace and they kana wahine akua, o
never went out of sight of each Namakaokahai. Eia nae, aole i
other; they were indeed a loving hanau, e hapai ana no i loko o
couple. It also became apparent ka opu, ua kapa o
that Namakaokahai, his god- Namakaokahai i ka inoa ke
wife, was with child. Before its hanau ae, o
birth, however, Namakaokahai Kauilanuimakehaikalani, oia kela
made known to her husband the uwila a kakou e ike nei i loko o
name of the child: it was ka wa ua. A o ka Aukelenuiaiku
Kauwilanuimakehaikalani 22 (the inoa hoi i kapa iho ai no ua keiki
lightning which we see in a rain- nei, o ka inoa o ke ’kua ona, o
storm). Aukelenuiaiku, however, Lonoikoualii.
wished to have the child called
after the name of his god
Lonoikoualii.

Because Namakaokahai loved A no ka nui loa o ko


her husband so much, she would Namakaokahai aloha i ke kane,
not allow him to go out of her ia Aukelenuiaiku, nolaila, pili paa
sight. They were together loa laua, i ke kau a me ka hooili,
constantly, at all seasons and i ka la a me ka ua, i ka wa wi a
times, in dry and wet weather, in me ka wa maona, i ka po a me
times of famine and of plenty, in ke ao, i na la a pau loa. Nolaila,
the daytime and at night, in fact ua hooili aku o Namakaokahai i
they were together all the time. kona waiwai a pau loa, mai luna
Namakaokahai also gave all her a lalo, mai uka a kai, mai ka mea
possessions to Aukelenuiaiku; uuku a ka mea nui, mai loko a
from the things that were above waho, maluna o kana kane.
to the things below; from the
things in the uplands to the
things in the lowlands; great
things and small things; the
things that were within to the
things that were without. All were
given to her husband.

CHAPTER XI. MOKUNA XI.

How Namakaokahai Ka Hooili ana o


Gave Everything to Namakaokahai i na mea
Aukelenuiaiku, Her a pau Maluna o
Husband, and the Aukelenuiaiku Kana
Battle that was Kane; ke Kaua ana o
Fought Between Kuwahailo me
Kuwahailo and Aukelenuiaiku i ka Lani.
Aukelenuiaiku in the
Heaven.
When Namakaokahai was ready Ia Aukelenuiaiku e noho pu ana
to give everything she me kana wahine, me
possessed to her husband, Namakaokahai, ua makaukau ko
Aukelenuiaiku, she called her ka wahine manao e hooili i na
brothers, Kanemoe, Kaneapua, mea a pau maluna o
Leapua and Kahaumana. As Aukelenuiaiku. Nolaila, kahea
they stood in her presence, she aku la o Namakaokahai i na
said to them: “You go up to my kaikunane ona ia, Kanemoe,
uncle and cousin, Kuwahailo and Kaneapua, Leapua,
Makalii, and inform them that I Kahaumama.
have given unto my husband all
my possessions. The things A hiki mai la lakou, olelo aku ko
above, below, in the uplands, in lakou kaikuahine, i aku la ia
the lowlands, the drift iron, the lakou: “E pii oukou i luna a olelo
iron 23 that stands in the earth, aku i kuu makuakane a me kuu
the whale’s tooth, the (ea) turtle kaikunane, o Kuwahailo, ka
shell, the things that grow in the makuakane, o Makalii, ke
land, and the cluster of stars. kaikunane, e olelo aku oukou.
Also, tell my uncle and cousin Ua hooili au i na mea a pau no
[76]that all these things are now kuu kane. O luna, o lalo, o uka, o
in my husband’s possession; kai, o ka hao pae, o ke meki ku i
and I also want you to take my ka honua, o ka palaoa, o ka ea
husband to them so that they makaulii, o ka maulele i ka aina,
may become acquainted with o ka huhui hoku. A e olelo aku
each other.” All these words of no hoi oukou i kuu makuakane a
Namakaokahai were pleasing to me kuu kaikunane, ua pau loa
them. keia mau mea a pau maluna o
kuu [77]kane, i ka hooili ia, a e
We must bear in mind that this lawe pu aku oukou i kuu kane i
trip to be undertaken by the ike mai laua.” Ma keia mau olelo
brothers of Namakaokahai and a Namakaokahai, he mea oluolu
Aukelenuiaiku was to heaven. loa ia ia lakou. Ma keia wahi a
kakou e hoolohe nei, e noonoo
iho kakou me ka manao oiaio, i
luna o ka lani, keia lele ana o
Aukelenuiaiku me na kaikoeke.

After Namakaokahai had Mahope o ko Namakaokahai


delivered her orders to her olelo ana mai ia lakou, lele aku
brothers, they began their flight, la lakou a ke kua, hiwi hoomaha,
going as far as the top of the ma ia lele hookahi ana, ua hala
mountains where they rested. In aku o Aukelenuiaiku i ka lani. Ma
this first flight Aukelenuiaiku keia lele ana o Aukelenuiaiku,
went on to heaven, reaching his hiki mua aku la ia i kahi o kana
wife’s place, a most sacred wahine, o Namakaokahai, he
sphere, not accessible to wahi kapu loa ia, aohe mea hele
anyone. Although they flew at ma laila. Ia Aukelenuiaiku e ku
the same time with ana ma kahi kapu o
Aukelenuiaiku, he got ahead of Namakaokahai, nana aku la o
his brothers-in-law and arrived in Kuwahailo, a olelo iho i loko ona:
heaven first. While “Auwe! make kuu kaikamahine,
Aukelenuiaiku was standing in ke hiki nei ke kupu i luna nei, no
the sacred place of ka mea, aohe kanaka nana e pii
Namakaokahai, he was seen by mai o luna nei, hiki no ke
Kuwahailo, who said to himself: kanaka, ua make o lalo.”
“Alas! I am afraid my niece is
dead; that is why a wizard has
arrived, for no one can get up
here unless those below are
dead.”

In this flight to heaven, Ma keia lele ana o Aukelenuiaiku


Aukelenuiaiku did not think that i luna i ka lani, aole ona manao
he was going to meet anyone he kaua, a he hakaka, ua lele
who would oppose him, and oia me ka nanea walewale. Aka,
consequently he went along maloko o ka olelo a kona akua ia
unguarded; but through the ia, a Lonoikoualii, he kaua, penei
powers of his god Lonoikoualii na olelo: “E Aukelenuiaiku e!
he was warned in time, for the make kaua, eia la he kaua ko
god called out to him: “Say, luna nei. E aahu oe i ko kapa
Aukelenuiaiku, watch or else we lehu mai ko poo a ko manea
will be killed, for I see that we wawae, mai lohi oe o make
are going to be attacked. Put on auanei.” Ma keia mau olelo a ke
your garment of ashes and cover ’kua ia Aukelenuiaiku, ma laila i
yourself from head to feet; don’t maopopo ai he kaua ko luna.
be slow or we will be killed.” By
this warning Aukelenuiaiku knew Mahope o ka olelo a ke ’kua ia
that a conflict was about to Aukelenuiaiku, oili mai la ka
begin, and he immediately put momoku ahi mai loko mai o ka
on his war pau. As soon as his lima o Kuwahailo a a ana i ka
god finished giving the warning a honua. O ka inoa o ua momoku
bolt of fire was sent out from the ahi la, o Kukuena, a mahope
hand of Kuwahailo and the land ona kuu ia mai la ka pohaku o
began to be in flames. The name Ikuwa, he pohaku koeleele, oia
of this bolt of fire was Kukuena. ka hekili. A pa keia mau mea i ke
After which a large black rock kapa lehu o Aukelenuiaiku, he
was sent out, called Ikuwa, the mea ole laua, he opala, he mea
thunder. When these things uhauha na ka makani. Ma keia
came in contact with the robe of moolelo, ua olelo ia, i ka wa i pa
ashes of Aukelenuiaiku, they ai ka hekili i ke kapa lehu o
became as nothing, like chaff Aukelenuiaiku, nolaila mai ka
and were blown away by the nakeke o ka hekili a hiki i keia la.
wind.

In this story it was said that when A mao ae la ka momoku ahi a


the thunderbolt came in contact me ka pohaku, nana aku la o
with the garment of Kuwahailo ia Aukelenuiaiku, e ku
Aukelenuiaiku it caused the mai ana no, aole i make. He
roaring and rumbling of the mea kaumaha loa ia i ko
thunder which is heard to this Kuwahailo manao ana, a he mea
day. After the bolt of fire was inoino loa i kona ike ana aku e
extinguished and the rock oia mai ana kona enemi, ke
became as nothing, Kuwahailo ahikanana o Kuaihelani. Ia wa,
looked at Aukelenuiaiku and lo, kuu hou o Kuwahailo i ka lua o
he was still in the place where he ka momoku ahi, oia o Mahuia, a
saw him, still alive. This grieved kuu hou i ka lua o ka pohaku, oia
Kuwahailo heavily: it bode dire o Welehu, o ka lua ia o na hekili
trouble that his enemy, the ikaika loa, nakeke, opaipai ka
defiant 24 of Kuaihelani, should lani, naueue na kukulu o ka
stand alive before him. After a honua, haki kaikoo o ka moana,
time he sent another bolt of fire, nakaka na pohaku, kahako ka
called Mahuia, and another rock, pali, lele ke koae. I ka pa ana i
called Welehu, the second ke kapa lehu o Aukelenuiaiku,
strongest bolt of thunder. The ua lilo ia i mea ole, heaha la
roar was deafening, the heaven kona ano, he puahiohio paha.
rocked, the foundations of the
earth were shaken, the waves of
the ocean rose high as
mountains, large rocks were
loosened from the cliffs, the cliffs
were opened up and the birds on
the mountain heights were
alarmed. When these came in
contact with the robe of ashes of
Aukelenuiaiku they became as
nothing, like a gust of wind.

After these death aims of A hala keia make a Kuwahailo, i


Kuwahailo he again looked and nana aku ka hana i ka oioi o
saw Aukelenuiaiku standing in Kuaihelani, e ku mai ana no,
the same place, and still alive. aole i make, i iho o Kuwahailo:
Kuwahailo then said to himself: “Ka! akahi no ka make ole o nei
“Here I have exhausted all my kanaka, no ka mea, o ka pau no
death-dealing weapons and still keia o na mea make, aohe make
that man is not killed yet. This is iho.” [79]
the first man that has been able
to withstand all this.” [78]

We will here leave Aukelenuiaiku Maanei e hoomaha iki kakou i ka


and Kuwahailo for a time while hoolohe ana no Kuwahailo, a me
we take up the brothers of Aukelenuiaiku, a e kamailio
Namakaokahai. In making their kakou no na kaikunane o
flight from the earth to heaven, Namakaokahai, na kaikoeke o
they saw that Aukelenuiaiku was Aukelenuiaiku. Ma keia lele ana
going much faster than they o lakou mai ka honua ae a ka
were. The length of time they lani, ua pakeu aku ko
took on this voyage was five Aukelenuiaiku lele i ko na
days and five nights, while kaikoeke. No ka mea, hookahi
Aukelenuiaiku covered the la, hookahi po o ka lele ana, o
distance in only one day and one Aukelenuiaiku mai ka honua ae
night: hence, when Kuwahailo a ka lani; elima la, elima po o ka
was pouring out his death- lele ana o na kaikoeke, hiki i ka
dealing bolts, the brothers were lani. Maloko o ka manawa lele o
still on their way. When they na kaikoeke, ko Kuwahailo
were approaching heaven, and manawa i kaua ai me
saw from a distance the fire-bolt Aukelenuiaiku i ka lani. A hiki na
called Kukuena, and the black kaikoeke i luna ma kahi kaawale
rock Ikuwa being hurled at i ko Kuwahailo wahi, ike mua ia
Aukelenuiaiku, they all cried out mai la ka momoku ahi o
in alarm, for they thought their Kukuena, a me ka pohaku
brother-in-law would be killed. koeleele o Ikuwa e lele mai ana i
They then flew to a rocky valley mua o lakou. Uwe iho la lakou i
and there laid down; after the fire ko lakou kaikoeke i ka make,
and the roar of the thunder had holo aku la lakou a moe leho i ke
gone by they came out, and kahawai ala, a pau ka lele ana

You might also like