Geometric Algebra and Its Application To Computer Graphics: D. Hildenbrand, D. Fontijne, C. Perwass and L. Dorst
Geometric Algebra and Its Application To Computer Graphics: D. Hildenbrand, D. Fontijne, C. Perwass and L. Dorst
Abstract
Early in the development of computer graphics it was realized that projective geometry is suited quite well to
represent points and transformations. Now, maybe another change of paradigm is lying ahead of us based on
Geometric Algebra. If you already use quaternions or Lie algebra in additon to the well-known vector algebra,
then you may already be familiar with some of the algebraic ideas that will be presented in this tutorial. In fact,
quaternions can be represented by Geometric Algebra, next to a number of other algebras like complex numbers,
dual-quaternions, Grassmann algebra and Grassmann-Cayley algebra. In this half day tutorial we will emphasize
that Geometric Algebra
• is a unified language for a lot of mathematical systems used in Computer Graphics,
• can be used in an easy and geometrically intuitive way in Computer Graphics.
Categories and Subject Descriptors (according to ACM CCS): G.4 [Mathematical Software]: Algorithm design and
analysis, Efficiency I.3.7 [Computer Graphics]: Animation
°
c The Eurographics Association 2004.
2 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
Contents
Part 1: Overview
1 Outline
1.1 Agenda
2 Introduction
3 History of Geometric Algebra
4 Properties of Geometric Algebra
4.1 Geometric Intuitivity
4.2 Unification
4.3 Low Symbolic Complexity
5 Foundations of Conformal Geometric Algebra
5.1 Blades and Products
5.2 The Blades of the Conformal Geometric Algebra
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 3
°
c The Eurographics Association 2004.
4 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 5
°
c The Eurographics Association 2004.
6 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 7
Table 1: List of the conformal geometric entities (IPNS). Table 2: List of the conformal geometric entities (OPNS)
†
This representation of a point is the same in the IPNS and
OPNS. entity OPNS representation grade
Point† P = x + 12 x2 e∞ + e0 1 Plane Π = x1 ∧ x2 ∧ x3 ∧ e ∞ 4
Circle Z = x1 ∧ x2 ∧ x3 3
Sphere s = P − 12 r2 e∞ 1
Line L = x1 ∧ x2 ∧ e ∞ 3
Plane π = n + de∞ 1
Point Pair Q = x1 ∧ x2 2
Circle z = s1 ∧ s2 2
Line l = π1 ∧ π1 2 Point P = x + 12 x2 e∞ + e0 1
Point Pair q = s1 ∧ s2 ∧ s3 3
Table 3: Notations
Point p = s1 ∧ s2 ∧ s3 ∧ s4 4
°
c The Eurographics Association 2004.
8 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
PART TWO
modifier LeftMouse MiddleMouse RightMouse
The Blades of the Conformal Model -none- Rotate Translate Zoom
Ctrl Select Select Translate
Daniel Fontijne & Leo Dorst
Table 4: Mouse actions.
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 9
°
c The Eurographics Association 2004.
10 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
at least if they are ‘in general position’. You can think of this always intersect in a circle, though this circle is not always
as removing (through the inner product) ’everything that is on the spheres! Such strange intersecting circles are in fact
not B’ from A. imaginary (in the sense that their radius has negative square),
and we have drawn them dashed to show that they are un-
But it is easier to remain in a dual representation, for
usual.
dual(A ∩ B) = dual(B) ∧ dual(A),
Now move dA around again, in different planes (by tilting
so basically intersection is an outer product in a dual repre- the view using LeftMouse-Drag), and note how intersections
sentation. dual(B) ∧ dual(A) can intuitively be understood change. They always exist, for the system is ‘closed’ due to
as computing the union of ’everything that is not B’ and ’ev- the inclusion of e∞ . If you’re precise and capable of placing
erything that is not A’. Then the dual of that must be what B some elements such that they touch or are parallel, you’ll
and A have in common. We will get back to understanding see some strange objects which we’ll discuss at the end of
this later in section 10, for now let’s just play with it. chapter 7.
The above suggests that we first construct the objects we If you’d like to play some more, DEMOincidence();
want using the outer product ∧; then dualize them all using is similar.
dual(); then use ∧ intersect them in this dual representation.
We may never choose to go back to the direct representation
7. Elementary objects
after this.
We can now unveil how CGA works, by going through some
So make dual representations of our objects that we still
of the details of the representation. To keep the explanation
have in the view:
down to earth, we will occasionally refer to a coordinate rep-
dynamic{ dsphere = dual(sphere) ;}, resentation. Although coordinates are not required to specify
dynamic{ dcircle = dual(circle) ;}, the operations of Geometric Algebra, they are of course still
dynamic{ dplane = dual(plane) ;}, useful to specify its objects. We also give all of the kinds of
dynamic{ dline = dual(line) ;}, objects that appear when we combine the span and dual op-
The ; before the final curly bracket is an instruction not erations (i.e. all intersections of spanned objects). After this
to draw the object constructed – if you want to see them, section, you will be able to define lines, planes, etcetera sim-
change it to a comma (but what you see for the circle may ply, and with the precise locational and directional properties
surprise you). you desire.
Now let’s form another dual sphere and show the intersec-
tions with the objects defined. Ignore how this dual sphere is 7.1. Rounds and flats
made for now, we just mention that it is at e0 and has unit You can best start this section with a clean display. Type
radius.
clearall();
dA = e0-einf/2,
This removes all objects and dynamics and clears the con-
Now for the intersections. Before we make them, we sim- sole.
plify the situation a bit by putting the points in more standard
positions relative to e0 . (To prevent mistakes, you could also We start with a point. The prototypical point is ‘e0 ’,
run the whole demonstration by typing the point at the (arbitrary) origin of our 3D space. Let us
again pay attention to the representation of points. Make
DEMOintersect();
a = e0 and move it around with Ctrl-RightMouse-Drag
which also gives you some handy labels for the quantities to to a new location. Then ask for its new representation, which
aid in dragging them - just do Ctrl-RightMouse-Drag on the will be something like:
label. It builds things up gradually, just keep pressing En- a
ter while you see the DEMOintersect prompt.) To draw a = 1.00*e1 + 0.50*e2 + 0.00*e3 +
things properly, we undualize them, though for continued 1.00*e0 + 0.625*einf
computations this is not really necessary.
The general expression of a point at a location relative to e0
a=pt(0), b=pt(e1), c=pt(e2), d=pt(e3), given by position vector the p (specified on the Euclidean
dynamic{ dAsphere = -dual( dA^dsphere ) ,} basis {e1, e2, e3} is:
dynamic{ dAcircle = -dual( dA^dcircle ) ,}
dynamic{ dAplane = -dual( dA^dplane ) ,} p = α pt(p) ≡ α ( e0 + p + 12 (p · p) e∞ ) )
The function pt() creates a point that is the point e0 shifted (where p · p is of course the squared norm of p, a scalar,
over the vector specified. As you move the dual sphere dA and α is a scalar). Thus the function pt( ) maps an Euclidean
around (Ctrl-RightMouse-Drag), you see the intersections vector to the CGA representation of a point at that relative
change. Note that some are peculiar: apparently, two spheres location. For instance:
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 11
p = pt(e1 + 2 e2) So you often see us use the dual unit sphere at the origin:
e0 -e∞ /2.
These points are the basic elements of CGA. The inner prod-
uct of CGA has been defined so that the basis elements of As you see, you can also make a sphere with a radius
{e1, e2, e3, e0 , e∞ } have the following inner products: whose square is negative, for instance:
e1 · e1 = e2 · e2 = e3 · e3 = 1 e0 + einf
2 ρ e∞
1 2
s = c− for a line in the e1-direction. Note that we need to put the
special point e∞ in as well (any line passes through infin-
is the dual representation of a sphere with center c and radius
ity).
ρ2 . Since s is a vector in CGA, we see that general vectors
‘are’ (weighted) dual spheres. Since a line is a grade 3 object, a dual line is of grade 2.
We have incorporated some tests that recognize these partic-
We will often make dual spheres at e0 , which are simply
ular grade 2 objects and draw them as the line they represent
e0 - einf * r * r / 2, – but in blue, as befits a grade 2 object.
°
c The Eurographics Association 2004.
12 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
With all these objects, you might think we are complete: a^(e1^einf)
what more can there be when you intersect round and flat which corresponds to the idea of a location/direction pair,
things except other round and flat things? However, there are algebraically composed. You can drop the brackets since the
several surprises. See what happens if you intersect a sphere outer product is associative, and change the order (giving a
with one of its tangent planes: minus sign each time you swap two vectors) – that retrieves
-dual( (e0-einf/2)^(e1+einf) ) the representation we have seen before.
Your display shows a disk, which the information bar in the
Controls panel tells you is a ‘tangent bivector’. It is what 7.4. That’s all
the sphere and the plane have in common at their point of
intersection, which is slightly more than merely the point. It The above really does exhaust the objects that can be made
is grade 3, and you can think of it as an infinitesimal circle by repeated application of outer product and dualization ap-
in a well-defined plane. We knew of no better way to draw it plied to vectors and hence as the ‘closure’ of the spans of
than this disk. points and their intersection. As you see, we have the classi-
cal repertoire of elements you use in linear algebra, and then
To make such a tangent object at the origin, type: some more: spheres and tangents, free elements. All these
e0^e1^e2 are precisely related algebraically. None of these is what we
call a ‘vector’ classically – that has in fact become an impre-
but beware: a tangent bivector at a point c is not made using cise usage, since a ‘normal vector’ a ‘direction vector’ and a
the construction c∧e1∧e2. Of course there are also tangent ‘position vector’ are all different (they react differently when
vectors, and you can make one at e0 by the origin is moved, or when the space is transformed). We
e0^e3 should reserve the term ‘vector’ for an element of the mod-
eling algebra, rather than for the elements of geometry.
7.3. Free blades (attitudes) CGA enables precise definitions for each vector-based
concept:
And still, this does not exhaust the possibilities of basic ob-
ject classes. Let us intersect two parallel planes: • ‘normal vector’ n (best seen as a dual plane n, which is
then automatically extended by translation to encode for
-dual( e1^(e1+einf)),
its location, see below)
and you find that the answer is • ‘direction vector’ v (best seen as the attitude v ∧ e∞ )
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 13
8. A visual explanation
We can also show you more visually why this surprising
Figure 5: Visualization of the intersection of circles in the
characterization of rounds by blades works. In this chap-
conformal model.
ter, we ‘pop up’ the e∞ -dimension graphically, by using
the 3D CGA as a specification language for OpenGL com-
mands, but we will necessarily show you only the CGA for
a 2-dimensional Euclidean geometry. For us, this depiction the metric of 2D CGA): it consists of all the vectors per-
helped to take quite a bit of the magic out (though not affect- pendicular to the vector x (in this metric). (It doesn’t look
ing the poetry of the procedure). perpendicular, but that is because we are watching with Eu-
clidean eyes.)
We have seen that a point at x is represented as:
If x is on the paraboloid, this plane is the tangent to the
pt(x) = e0 + x + 12 x2 e∞
paraboloid at that point. (Confirm this for yourself, if neces-
In 2D, this requires a 4D space with a basis like sary by changing your viewpoint.) How would we express
{e0 , e1, e2, e∞ }. This would seem hard to visualize. How- this? Well, in homogeneous coordinates x is on a plane P iff
ever, the e0 -dimension works very much like the extra x ∧ P = 0. Or, if we have a dual representation of the plane,
dimension in homogeneous coordinates: it allows you to p = dual(P), then x is in the plane iff x · p = 0. You will
talk about ‘offset linear subspaces’, linear subspaces that remember that the metric of CGA is set up in such a way
are shifted out of the origin (you can run DEMOhomoge- that x · x = 0, and the motivation for that was that a point
neous(); to remind yourself of this). So because of the represented by x has distance 0 to itself in the Euclidean
e0 -term, we are allowed to draw planes, lines, et cetera that metric. We now see that we can also read this as: if the vec-
do not need to go through the origin. If you accept that, we tor x represents a Euclidean point, then x is on the plane
do not need to draw this dimension explicitly, we can just use dually represented by x in CGA. This is all consistent, for
this freedom and know that such things are blades because the parabola is given by the CGA metric, which in turn was
of the e0 -dimension. designed to make the inner product of points be related to
The e∞ -dimension is new, and much more interesting. If the (squared) Euclidean distance.
we draw the Euclidean 2-space as the e1 ∧ e2-plane, then In the 2D CGA metric, the duality of a point to a plane
there is apparently a paraboloid 12 x2 in the e∞ -direction works in a matter that you may discover by moving the point
that we should get to know better. around: project the point x onto the parabola by a (vague red)
Just execute the command line perpendicular to the Euclidean 2-space. The dual plane
for x will be parallel to the tangent plane at this intersection
DEMOc2ga(); point, but as far above the paraboloid as x is below it (or vice
By hitting return, it will execute various stages of our visual- versa).
ization. For now, stop at the step where it says: DEMOc2ga You see that the plane intersects the paraboloid in an el-
initialized » . (If you hit too far, just keep doing it lipse (if you are at the proper side of it), and that we have
till your prompt returns to the regular prompt, then restart drawn a circle in the 2D Euclidean plane as its projection.
DEMOc2ga().) You see the 2-dimensional Euclidean space Apparently, there is a direct correspondence between the
laid out in white, and the e∞ -paraboloid indicated vertically dual of a vector (the plane) and a Euclidean circle. But we
above it. The sliders in the bottom right of your window al- know that there is. Let c be the representation of a Euclidean
low you to play with pan and tilt for better views. point – so c is on the paraboloid. Now subtract 21 ρ2 e∞ from
Now we can play around. Let us first interpret a point x c, which gives the vector
– actually, we use flat points like x ∧ e∞ . Hit return till you
s = c − 12 ρ2 e∞
get to: DEMOc2ga visualization of x » . As you
move the red vector x around (by dragging its point), you see This is the dual representation of a sphere (and in 2D, a
a yellowish plane move with it. This plane is the dual(x) (in sphere is a circle). But it is also a general vector of the form
°
c The Eurographics Association 2004.
14 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
we have just moved around. If we enquire which actual Eu- Here is the take-home message of all this visualization:
clidean points are on this set, we have to enquire for which In 2D CGA, ‘intersecting circles’ is identical to
vectors x, which satisfy x · x = 0, the equation x · s = 0 ‘intersecting homogeneous planes’ in 1 more di-
holds. The former demand is: x lies on the paraboloid, and mension, which in yet 1 more dimension is identi-
the latter: x lies on the plane dual to s. Together you can cal to ‘intersecting subspaces through the origin’
work it out as: – which is easy to do. So intersecting circles is
0 = x · (c − 12 ρ2 e∞ ) = − 12 dE2 (x, c) + 12 ρ2 easy – and so is intersecting general rounds in nD.
Since spheres are important to Euclidean geometry (planes
(using x · e∞ = −1, true for normalized points). So indeed
and lines et cetera are merely affine, not Euclidean), this is
these are the points x that have squared distance ρ2 from c.
a relevant trick. We hope you now understand slightly better
As you move the point s ‘inside’ the parabola, the dual where those two extra dimensions come from.
plane lies outside it, and it seems there is no intersection.
Actually, the intersection is imaginary, leading to a sphere 9. Practicalities
with negative radius squared, but we hope that the interactive
depiction provides the confidence that this is all completely This section treats some practicalities that might be among
regular. the first problems that a computer graphics practitioner todo
would have to tackle to write a real application using confor-
There is a small artifact of our depiction: if you would mal Geometric Algebra.
have x precisely on the paraboloid, the circle should
degenerate to a 2D CGA point. But in our depiction
9.1. Parameters
(which fakes this using 3D CGA geometry), it actually
becomes a 3D CGA tangent bivector. Try it by defining If we want to draw the blades from the conformal model,
x = pt(e1+e3/2). we need to break them down into parameters such as loca-
tion and attitude that we can send to OpenGL. Having these
Now hit return again in the demo, to get to the
parameters can also be handy for other parameters, such as
prompt "DEMOc2ga visualization of x and y
breaking a point pair up into to separate points.
» ". The construction shows how the intersection of two
spheres (circles in 2D) is done in CGA, and we explain it as In principle, computing parameters of the various kinds of
follows. blades is not too hard. For instance, the square of a normal-
ized dual sphere gives you its radius squared, for
A point pair is a 1D sphere. We know that the 2D CGA
model would represent this as the outer product of two vec- (e0 − 12 e∞ ρ2 )2 = − 21 (e0 e∞ + e∞ e0 ) ρ2 = ρ2
tors x ∧ y, i.e. as a line in this homogeneous depiction. For For the direct representation of a round there may be extra
two vectors representing points, this is easy enough: the vec- signs (depending on its grade), and for a general formula you
tors lie on the parabola, and so the intersection of the line need to normalize first. Tangents have size 0, and for the flats
with the parabola precisely retrieves the points. If the vectors and attitudes, size is not an issue, they don’t really have any.
x and y are off the paraboloid, they represent dual circles.
Then their outer product dually represents the intersection Instead, attitudes and flats only have a weight, an overall
of those circles. Undualizing should then provide the direct multiplicative factor relative to unity. The weights of 2e1, of
representation of this intersection, i.e. a point pair. 2e1 ∧ e∞ , of 2e0 ∧ e1 ∧ e∞ are all 2, but so is the weight
of the tangent 2e0 ∧ e1 and the dual round 2e0 − e∞ . So
In the terminology of our visualization: make the planes tangents and rounds have weights too. In some cases, these
corresponding to the vectors x and y, and intersect them to weights have a traditional way of displaying: a vector of
form a line `. That is the representation of the intersection weight 2 can be depicted as having length 2, and a tangent
of the circles. To find the point pair, ask which points lie in bivector of weight 2 as an area element of 2 areal units. But
the set `; you do that by intersecting ` with the paraboloid. we have not decided how to depict a sphere of weight 2, and
If it really intersects, the point pair is real, and otherwise if we would draw points (i.e. dual spheres of zero radius)
imaginary (in a location that is rather counterintuitive but as different sizes, they would easily become confused with
can be explained with some effort – look for hyperbolas, if spheres. So for some objects, you will just have to monitor
you must...). the weight, for instance using the ‘Controls’ panel.
Move x and y around from the initial situation to get a The set of functions defined in confor-
feeling for how it is all connected. And you may enjoy typ- mal_blade_parameters.g defines the various
ing the following to try a situation with two tangent circles blade parameters as the functions. The actual computations
(zoom, pan, tilt if necessary): are indicated in table 5.
x = pt(-1.5 e2 + e3), The location of a blade could be the Euclidean coordi-
y = pt(-2 e2 + 1.5 e3), nates of some relevant point. For a round, this is naturally the
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 15
p ∧ (∞E−1 ) p · (∞E−1 ) 1 b −1
inverse none none 2 Tp ((o/α + ∞)E )
Table 5: All non-zero blades in the conformal model of Euclidean geometry, and their parameters. For a round, the squared
size α equals radius squared, for a dual round it is minus the radius squared. Locations are denoted by dual spheres. The points
q are probes to give locations closest to q, one can just use o = e0 . We denote e∞ = ∞, and Xb is the grade inversion (−1)x X
with x = grade (X), while Xe is the reversion (−1)x(x−1)/2 X. For more information see test [Dor03].
center, but for planes and lines such a point is not uniquely // get center & attitude of point pair ’pp’:
indicated in a coordinate free manner. We can either take the L = location(pp),
point closest to the origin (obviously not coordinate-free) or A = attitude(pp),
closest to some given point q. The formulas in the table ac- // compute translation versor...
tually produce a normalized dual sphere as the location; this // ...in direction of A:
T = exp(0.25 A);
is often enough, or you can take its Euclidean part as the Eu-
clidean location vector (usable in a translation versor tv()), // translate ’L’ over ’T’ one way:
or compute the center by reflection e∞ into the round X of p1 = T * L * inverse(T),
grade k by: // translate ’L’ over ’T’ the other way:
X e∞ X p2 = inverse(T) * L * T
c = − 21
(e∞ · X)2 In general, p1 and p2 will be dual spheres. They can be
All these class-dependent functions have been collected in turned into regular points adding their radius times 0.5e∞ :
conformal_blade_parameters.g, but in a rather p1 = p1 + 0.5 p1.p1 einf,
coded way for fast usage. The most useful are: p2 = p2 + 0.5 p2.p2 einf,
°
c The Eurographics Association 2004.
16 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
These angles can be computed in the same way as with reg- Key to the correspondence of geometrical intuition and al-
ular vectors. Say that the two normalized lines/planes are gebraic expressions are two rules, involving ‘being part of’
called x1 and x2, we compute cosine of the angle between and ‘being perpendicular to’. Both can be given in direct
them as form, and in dual form, and all four together provide our
ca = x1 . x2
framework. We state them without proof. (In each of these
expressions, the inner product is the default in our software:
To see why this is true, first write: the contraction inner product.) We use the notation ·∗ to de-
x1 = px1 ∧ Ex1 ∧ e∞ note dualization, for easy reading of the formulas.
x2 = px2 ∧ Ex2 ∧ e∞ • containment: for vector x and blade A (with grade at least
1)
By this we mean what each xi can be factored as the outer
product of a point pi , a purely Euclidean element Ei and the x ∈ A ⇐⇒ x ∧ A = 0 = x · A∗
point at infinity. We can then proceed to derive:
• perpendicularity for blade A and blade B (with
x1 · x2 = (px1 ∧ Ex1 ∧ e∞ ) · (px2 ∧ Ex2 ∧ e∞ ) grade (A) ≤ grade (B))
= px1 · (Ex1 · (e∞ · (px2 ∧ Ex2 ∧ e∞ ))) A ⊥ B ⇐⇒ A · B = 0 = A ∧ B∗
= −px1 · (Ex1 · (Ex2 ∧ e∞ )) Let us play with that. Suppose we have three spheres A, B, C,
= −px1 · (Ex1 · Ex2 e∞ ) and are looking for the GA object X that is perpendicular to
= Ex1 · Ex2 each. We therefore need to satisfy X ·A = 0, X ·B = 0, X ·C =
0. Dualizing this, we get X ∧ A∗ = X ∧ B∗ = X ∧C∗ = 0. The
So x1 · x2 just computes the inner product of the Euclidean simplest object satisfying this is:
part of both blades. If the blades are not normalized, then we
√ √ X = A∗ ∧ B∗ ∧C∗
should divide the result by x1 · x1 x2 · x2 ; again, just as
with regular vectors. Angles between other (non-flat) primi- Done. Let’s show it.
tives can be computed with similar formulas, although com-
puting the angle between primitives that are not of the same clearall();
grade is more involved. a = e0-einf/4, b = e0-einf/2, c = e0-einf,
dynamic{ X= a^b^c,}
We have constructed elements by spanning, or by intersec- The outcome is interesting. The direct representation of
tion of spanned quantities. There are many geometrical prob- the object perpendicular to other objects is the outer prod-
lems in which this is enough, but CGA also allows direct uct of their duals. Shrinking the spheres to points, you see
specification of objects with different partial data. When we that you get a circle through them. So in this interpretation,
explore the rules involved, we seem to uncover a new and points are small dual spheres, and to ‘pass through’ a point
compact language for Euclidean geometry. In this section, means to cut its corresponding direct sphere perpendicularly.
we give you a feeling for this very new subject, attempting This neatly unifies the point description with the spheres in
to develop algebraic rules and geometric intuition in tandem. one consistent scheme. This is a subtle point, and it pays to
pause here a moment to let it sink it and make it your own.
Let us see how we could specify a sphere of which we
know the center c and one point p on it. Recall that the repre- Now let us revisit the object p · (c ∧ e∞ ). It was a dual
sentation of a dual sphere with center c was: s = c − 12 ρ2 e∞ . sphere through the point p, with center c. Dualizing this, we
If we know a point p on it, we must have p · c = − 12 ρ2 . Re- see that it is the direct object
arranging terms (using the distributive law of inner product p ∧ (c ∧ e∞ )∗ .
over outer product, as well as p · e∞ = −1) we find that the
dual representation is: With what we have just learned we see that this indeed con-
tains p, and that we can think of it as being perpendicular to
c + (p · c)e∞ = p · (c ∧ e∞ ) the flat point c ∧ e∞ . Since the result has to be the sphere,
This is immediately converted into GAViewer commands: this suggests the intuitive picture of Figure 6: a flat point
has ‘hairs’ extending to infinity, and our object cuts them or-
clearall(); // clear screen, dynamics thogonally. These hairs therefore help to construct an object
p = e0, c = e0, label(p); consisting of points equidistant to c.
dynamic{ s = p.(c^einf), }
At the right of the figure, we see a similar explanation for
Drag p and/or c to see the result. Notice that the sphere is
the construction of the midplane between two points p and
drawn in red, since it is a dual sphere. Note also that c ∧ e∞
q, which is q − p, or written multiplicatively and dualized:
is a ‘flat point’ – we will get back to the geometrical intuition
behind this equation below. (q − p)∗ = (e∞ · (p ∧ q))∗ = e∞ ∧ (p ∧ q)∗ .
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 17
r
p
c
p q
S p c
P p q
(a) (b)
Therefore the direct representation contains e∞ and cuts p∧ represented as b − a, c − a and d − a, and the dual of their in-
q orthogonally, a fair description of the midplane. tersection is their outer product. However, this is not merely
the center m, since e∞ is also on all planes. Therefore:
If we replace e∞ with a finite point r, we get r · (p ∧ q).
Please explore its meaning yourself, and verify your insights (m ∧ ∞)∗ = α (b − a) ∧ (c − a) ∧ (d − a)
using a small implementation.
(which α some proportionality constant) This helps use re-
With what we have learned, we can also interpret an object late the two immediately. The dual representation gives 0 =
like x · s, and we dualize this and rearrange:
p ∧ e1 ∧ e∞ . 0 = (x · (a · (m ∧ ∞)))∗
It contains the points p and e∞ , and should be orthogonal = x ∧ (a · (m ∧ ∞))∗
¡ ¢
to e1∗ , which is the (e2 ∧ e3)-plane through the origin. Ob- = x ∧ a ∧ (m ∧ ∞)∗
viously this is the line through p in the e1 direction. = α x ∧ (a ∧ (b − a) ∧ (c − a) ∧ (d − a))
Now you can play with DEMOortho(); and get some = α x ∧ (a ∧ b ∧ c ∧ d)
more intuition for the construction of such blades. It con-
structs the circle through p perpendicular to the planes du- This is of the form 0 = x ∧ S, so we have found the direct rep-
ally characterized by e1 and e2, you would simply type: resentation. Done! And this also shows why the representa-
tion space for 3D Euclidean geometry is 5-dimensional: the
dp1 = e1, dual of a vector is a 4-blade.
dp2 = e2,
p = e0, It is rather satisfying that such geometrically involved
dynamic{c = p^dp1^dp2,}, computations can be done so simply in CGA, without even
introducing coordinates!
In the setup in the demo, this gives a 2-tangent, and as you
move p a little you see that that is in a sense an infinitesimal
circle. Then DEMOortho(); proceeds to construct more 11. Summary and conclusion
elements (see its legenda in the upper left), which you should This concludes our cursory exploration of the blades of the
try to understand. conformal model of Euclidean geometry. As you have seen,
Let’s get back to the incidence operation A ∩ B = many familiar but not-so-well defined elements from prac-
−dual(dualB ∧ dualA) from section 6.3. We now recognize tical geometry find a home here, and are enriched by their
the outcome as the dual of a blade that is the composed (by relationship with other elements.
spanning) of elements perpendicular to both A and B. The We have not touched upon operations and the correspond-
result is therefore in both A and B. ing calculus at all, and have done very little that could be
We can use our new insights to show the relationship seen as an ‘application’. Our main goal was to give you a
between the direct representation of a sphere as the outer good understanding of the basics: why it works, and what
product of four points S = a ∧ b ∧ c ∧ d, and the dual rep- makes it different from more classical methods.
resentation by a center m and a point a on it which is If you want to learn more, you can try
s = a · (m ∧ e∞ ). This is illustrated in DEMOspheres();, the more detailed tutorial at our website
which you may run in tandem with the algebraic explanation http://www.science.uva.nl/ga/ of which
below. tutorial this was just a selection. On our website, you can
We realize that the center should be the intersection of the also find GABLE, a gentle introduction to 3D Geometric
midplanes of three points pairs. These midplanes are dually Algebra, and other tutorial papers.
°
c The Eurographics Association 2004.
18 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 19
In this introduction we will neglect many algebraic as- 12.1. The Outer Product
pects and introduce Geometric Algebra as an extension of
Without explaining exactly what it is, we can define a Geo-
the standard vector algebra. The actual algebra product is
metric Algebra on Rn , G(Rn ) or simply Gn if it is clear that
called "geometric product", but we will not start this dis-
we are forming the Geometric Algebra over the reals. The
course by discussing this product. Instead, we start by intro-
latter will in fact be the case for the whole of this text.
ducing the "inner product" and "outer product", which can
be regarded as special "parts" of the geometric product. This The outer product is an operation defined within this alge-
"top-down" approach is hoped to show the applicability of bra and is denoted by ∧. Here are the properties of the outer
the mathematics before giving a lot of details that may con- product of vectors. Let a, b, c ∈ En .
fuse the reader. a∧b = −b ∧ a
(a ∧ b) ∧ c = a ∧ (b ∧ c) (1)
In the following the terms "scalar product" and "inner
a ∧ (b + c) = (a ∧ b) + (a ∧ c).
product" will be used quite often, and it is important to un-
derstand that in this text these two terms refer to quite differ- Another important property is
ent operations. Depending on which books you have read
a ∧ b = 0 ⇐⇒ a and b are linearly dependent. (2)
before, you may be used to employing these terms inter-
changeably. Here, a scalar product is a product which results Let {a1 , . . . , ak } ⊂ Rn be k ≤ n mutually linearly indepen-
in a scalar - no more, no less. This scalar is in general an dent vectors. Then
element of R, in particular it may also be zero or negative.
(a1 ∧ a2 ∧ . . . ∧ ak ) ∧ b = 0, (3)
This may, for example, occur if the basis of the vector space
we are working in is not Euclidean. This will in fact turn up if and only if b is linearly dependent on {a1 , . . . , ak }. The
in conformal space. outer product of k vectors is called a k-blade and is denoted
by
The operation termed "inner product" here, may coincide
k
^
with the scalar product, but represents in general an alge- Ahki = a1 ∧ a2 ∧ . . . ∧ ak =: ai .
braic operation which does not result in a scalar. This will i=1
be explained further in section 12.4. One may also say that
The grade of a blade is simply the number of vectors that
the scalar product is a "metric" operation, since it depends
"wedged" together give the blade. Hence, the outer product
on a metric, while the inner product is an algebraic opera-
of k linearly independent vectors gives a blade of grade k, a
tion, which can also be executed without the knowledge of a
k-blade.
metric.
So let’s start with a 3d Euclidean vector space denoted 12.2. The Outer Product Null Space
by E3 . We will use the coordinate representation R3 for E3 .
We assume that the standard scalar product is defined on E3 . In Geometric Algebra, blades, as defined above, are given a
It will be denoted by ∗. Furthermore, the usual vector cross geometric interpretation. This is based on their interpretation
product exists on E3 and will be written as ×. Recall that the as linear subspaces. For example, given a vector a ∈ Rn , we
scalar product gives the length of the component two vec- can define a function Oa as
tors have in common. The vector cross product, on the other Oa : x ∈ Rn 7→ x ∧ a ∈ G(Rn ).
hand, results in a vector perpendicular to both of the initial
vectors. For example, let a, b, c ∈ E3 , then The kernel of this function is the set of vectors in Rn that
Oa maps to zero. This kernel will be called the outer product
null space (OPNS) of a and denoted by NO(a). That is,
a∗b ∈ R and a × b ∈ E3 . © ª
kern Oa = NO(a) := x ∈ Rn : x ∧ a = 0 ∈ G(Rn ) . (4)
Furthermore, We already know that x ∧ a is zero if and only if x is linearly
dependent on a. Therefore, NO(a) can also be given in terms
c = a × b ⇒ c ⊥ a and c ⊥ b. of a as
© ª
NO(a) = α a : α ∈ R ,
A plane in E3 is typically represented by its normal and an
offset vector. Given two vectors that are to span a plane, which means that the OPNS of a is a line through the origin
the vector cross product can be used to find the plane’s nor- with the direction of a. In Geometric Algebra it is therefore
mal. However, this only works in 3d. In higher dimensions said that a vector in En represents a line.
the (standard) vector cross product of two vectors is not de-
Given a 2-blade a ∧ b ∈ G(Rn ), where a, b ∈ Rn , a func-
fined.Nevertheless, we may be interested in describing the
tion Oa∧b can be defined as
two dimensional subspace spanned by two vectors also in a
n-dimensional vector space. Oa∧b : x ∈ Rn 7→ x ∧ a ∧ b ∈ G(Rn ).
°
c The Eurographics Association 2004.
20 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 21
scalar product, ie The symbol A ehki denotes the reverse of a blade. The re-
verse is an operator that simply reverses the order of vectors
a · b = a ∗ b. V
in a blade. For example, if Ahki = ki=1 ai then
This may be called the "metric" property of the inner prod-
1
^
uct, since the result of the scalar product of two vectors de- ehki =
A ai = ak ∧ ak−1 ∧ . . . ∧ a1 . (13)
pends on the metric of the vector space they lie in. However,
i=k
the inner product also has some purely algebraic properties
for elements in G(Rn ), which are independent of the metric Since the outer product is associative and anti-commutative,
of the vector space Rn . In the following a number of these the reordering of vectors in a blade can only change the
properties are stated without proof. blade’s sign. For the reverse we find in particular
Let a, b, c ∈ Rn , then the bivector b∧c ∈ G(Rn ). The inner ehki = (−1)k(k−1)/2 Ahki .
A (14)
product of a with this bivector gives,
So, why do we need the reverse in the definition of the
a · (b ∧ c) = (a · b) c − (a · c) b. (9)
inverse of a blade? The answer is, that the reverse takes care
Since (a · b) and (a · c) are scalars, we see that the inner of a sign that is introduced due to the grade of a blade. As
product of a vector with a bivector results in a vector. More an example consider the orthonormal basis {ei } of Rn . From
generally it may be shown that for k ≥ 1 equations (12) and (10) it follows that
¡ ¢
x · Ahki = (x · a1 ) (a2 ∧ a3 ∧ a4 ∧ . . . ∧ ak ) (e1 ∧ e2 ) · (e1 ∧ e2 ) = e1 · ¡(e2 · e¢1 )e2 − (e2 · e2 )e1
− (x · a2 ) (a1 ∧ a3 ∧ a4 ∧ . . . ∧ ak ) = e1 · − e1
+ (x · a3 ) (a1 ∧ a2 ∧ a4 ∧ . . . ∧ ak ) = −1.
− etc.
On the other hand, obviously e1 · e1 = 1. That is, depending
k £ ¤
= ∑ (−1)(i+1) (x · ai ) Ahki \ ai , on the grade of a blade (a vector being a blade of grade 1),
i=1 an additional sign is introduced or not. This is fixed by the
(10) reverse. Given any blade Ahki ∈ G(Rn ), then
where [Ahki \ ai ] denotes the blade Ahki without the vector
ai . Here the inner product of a vector with a k-blade results ehki = kAhki k2 ,
Ahki · A
in a (k − 1)-blade. An example of another important rule is
whereas
this
¡ ¢ Ahki · Ahki = (−1)k(k−1)/2 kAhki k2 . (15)
(a ∧ b) · Ahki = a · b · Ahki , (11)
with k ≥ 2. More generally, the inner product of blades
Ahki , Bhli ∈ G(Rn ), with 0 < k ≤ l ≤ n, can be expanded 12.6. Geometric Interpretation of Inner Product
as We can already get an idea of what is happening by looking
³ ¡ ¢´
Ahki · Bhli = a1 · a2 · . . . · (ak · Bhli ) . (12) at the Geometric Algebra of R2 , G(R2 ) with orthonormal
basis {e1 , e2 }. The outer product e1 ∧ e2 spans the whole
Hence, the result of this inner product is a (l − k)-blade. space, ie a plane. Now let’s look at the inner product of e1
with this bivector.
In comparison to the outer product we see that the inner
and the outer product are antagonists: while the outer prod- e1 · (e1 ∧ e2 ) = (e1 · e1 ) e2 − (e1 · e2 ) e1 = e2 . (16)
uct increases the grade of a blade, the inner product reduces
This may be interpreted as "subtracting" the subspace repre-
it.
sented by e1 from the subspace represented by e1 ∧ e2 . What
is left after the subtraction is, of course, perpendicular to e1 .
12.5. The Inverse of a Blade
More generally, let x, y, a, b ∈ Rn and let
Similar to the formula for vectors, the inverse of a blade
Ahki ∈ G(Rn ), k ≤ n, is in general given by y = x · (a ∧ b) = (x · a) b − (x · b) a.
°
c The Eurographics Association 2004.
22 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 23
With respect to R3 , NO(e1 ) may therefore be called the com- the unit pseudoscalar. With respect to the OPNS we have
plement set to NO(e2 ∧ e3 ). Furthermore, ¡ ¢ ¡ ¢
NO e2 ∧ e3 ⊕ NO (e2 ∧ e3 )∗ = R3 .
NI(e1 ) = R3 ª NO(e1 ).
It is now also clear that the relation between the OPNS
The question now is: can we find an operation in G(Rn ) and IPNS is the duality. For example, we have seen before
which transforms any blade Ahki ∈ G(Rn ) into a comple- that
mentary blade Bhn−ki ∈ G(Rn ), such that ¡ ¢ ¡ ¢ ¡ ¢
NO e2 ∧ e3 = R3 ª NO e1 = NI e1 .
NO(Ahki ) = Rn ª NO(Bhn−ki ).
Since e1 = (e2 ∧ e3 )∗ we have
Such an operation does indeed exist and is called the dual. ¡ ¢ ¡ ¢
NO e2 ∧ e3 = NI (e2 ∧ e3 )∗ .
The dual of a multivector A ∈ G(Rn ) is written A∗ and is
defined as In general we have for some blade Ahki ∈ G(Rn )
¡ ¢ ¡ ¢
A∗ := A · I −1 , (21) NO Ahki = NI A∗hki . (22)
−1 n
where I is the inverse unit pseudoscalar of G(R ). It is a
nice feature of Geometric Algebra that the dual can be given 12.9. Geometric Interpretation of the IPNS
as a standard product with a particular element of the alge-
bra. However, this has also the drawback that the dual of the
dual of a multivector may introduce an additional sign. That
is,
¡ ∗ ¢∗ ¡ ¢ ¡ ¢
A = A · I −1 · I −1 = A I −1 · I −1 .
Why the last step in this equation works will be shown later
on in equation (31), page 26. If we believe this equation for
the moment, then it shows that an additional sign is intro-
duced whenever I −1 · I −1 = −1. Since I −1 is a n-blade in
G(Rn ) we know from equations (14) and (15) that
I −1 · I −1 = (−1)k(k−1)/2 kI −1 k2 = (−1)k(k−1)/2 .
°
c The Eurographics Association 2004.
24 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
vector spans a higher dimensional space than a where I is the unit-pseudoscalar of G(R3 ). Let Ah3i be given
plane. Nevertheless, a bivector always describes a by
plane, independent of the dimension it is embed-
Ah3i := a ∧ b ∧ c.
ded in.
If Ah3i 6= 0 then a, b and c are linearly independent. In order
Now that we are happy that a vector in R3 represents a
to find the IPNS of Ah3i , we need to find which vectors x
plane with respect to its IPNS, we can ask what the IPNS
satisfy x · Ah3i = 0. Using again equation (10) it follows
of blades of higher grade is. Consider the non-zero bivector
a ∧ b ∈ G(R3 ). In order to give its IPNS we have to find x · Ah3i = (x · a) (b ∧ c)
which vectors x ∈ R3 satisfy x · (a ∧ b) = 0. With the help of − (x · b) (a ∧ c)
equation (10) we find + (x · c) (a ∧ b).
x · (a ∧ b) = (x · a) b − (x · b) a. The bivectors (b ∧ c), (a ∧ c) and (a ∧ b) are linearly inde-
pendent and thus x · Ah3i = 0 if and only if
Since we assumed that a ∧ b 6= 0, a and b have to be lin-
early independent. Therefore, the above expression can only x · a = 0 and x·b = 0 and x · c = 0.
become zero if and only if
Geometrically this means that x · Ah3i = 0 if and only if x
x·a = 0 and x · b = 0. lies on the intersection of the three planes represented by
a, b and c. Since all planes represented through the IPNS
Geometrically this means that x has to lie on the plane rep-
of vectors pass through the origin, the only point all three
resented by a and on the plane represented by b, in their
planes can meet in is the origin. Hence, the only solution for
IPNS. Hence, x lies on the intersection of the two planes
x to x · Ah3i = 0 is the trivial solution x = 0 ∈ R3 . Figure 12
represented by a and b. This shows that the outer product
illustrates this.
of two vectors represents the intersection of their separately
represented geometric entities. In terms of sets this reads
NI(a ∧ b) = NI(a) ∩ NI(b). (23)
Such an intersection line also has an orientation, which in
this case is given by (b ∧ a)∗ .
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 25
of the plane in term of the IPNS by taking the dual of the where I is the pseudoscalar of G(R3 ). The problem is that
bivector. Suppose that c ∈ R3 is given by c = (a ∧ b)∗ , then the line NO(e2 ) and the plane NO(e2 ∧ e3 ) live in a 2d-
¡ ¢ ¡ ¢ ¡ ¢ subspace of R3 spanned by e2 and e3 . The dimension e1 is of
NI c = NI (a ∧ b)∗ = NO a ∧ b .
no importance for the evaluation of their intersection. Sup-
Using a so far unproven property of the inner product (equa- pose now that we work in the subalgebra G(R2 ) ⊂ G(R3 ),
tion (31)), we can also write where {e2 , e3 } give an orthonormal basis of R2 . Then the
c·I = (a ∧ b)∗ · I respective unit pseudoscalar is I = e2 ∧ e3 and I −1 = e3 ∧ e2 ,
¡ ¢ and we obtain
= (a ∧ b) · I −1 · I
= (a ∧ b) (I −1 · I) e2 ∗ = −e3 and (e2 ∧ e3 )∗ = 1.
= a ∧ b,
Hence, the regressive product now gives
where I is again the unit pseudoscalar of G(R3 ). That means, £ ¤
e2 O (e2 ∧ e3 ) = £e2 ∗ ∧ (e2¤∧ e3 )∗ · I
in order to transform an IPNS representation into an OPNS = − e3 ∧ 1 · I
representation, we have to multiply with the unit pseu- = −e3 · I
doscalar, a kind of "inverse" dual. In terms of sets, = e2 ,
¡ ¢ ¡ ¢ ¡ ¢
NO a ∧ b = NO c · I = NI c . which is what we want. This shows that the regressive prod-
uct works, if we evaluate it in the correct subalgebra. This
Now we can see how to express the intersection of two notion is captured in the general intersection operation: the
subspaces in terms of the OPNS of two blades. Suppose meet.
a1 ∧ a2 , b1 ∧ b2 ∈ G(R3 ) represent two planes in terms of
their OPNS. Let their respective normals be denoted by The meet is basically the regressive product where
na = (a1 ∧ a2 )∗ and nb = (b1 ∧ b2 )∗ . Then in terms of the the pseudoscalar is chosen appropriately. "Appropriately"
IPNS the intersection of the two planes is given by na ∧ nb . means that instead of the pseudoscalar of the whole space,
As we have seen above, the corresponding expression of the the pseudoscalar of the space spanned by the two blades of
intersection line in terms of the OPNS is simply (na ∧ nb ) · I. which the meet is to be evaluated, is used. This introduces
Substituting now for na and nb gives, the concept of the join.
£ ¤
(a1 ∧ a2 )∗ ∧ (b1 ∧ b2 )∗ · I. Given two blades Ahki , Bhli ∈ G(Rn ), then their join is a
unit blade J ∈ G(Rn ) such that
This is actually not quite the general intersection operation
we were looking for, but it is already pretty good and is NO(J) = NO(Ahki ) ⊕ NO(Bhli ).
thus given its own name: the regressive product. Here is the The join is sometimes also written as an operator, denoted
proper definition. by ∧.
˙ For example, the join of e2 and e2 ∧ e3 is simply
Let A, B ∈ G(Rn ) be two arbitrary multivectors and let I e2 ∧
˙ (e2 ∧ e3 ) = e2 ∧ e3 ,
denote the unit pseudoscalar of G(Rn ). The regressive prod-
uct is denoted by O and is defined as since ke2 ∧ e3 k = 1 and
£ ¤
AOB := A∗ ∧ B∗ · I. (24) NO(e2 ∧ e3 ) = NO(e2 ) ⊕ NO(e2 ∧ e3 ).
Aside. Note that this definition of the join does
For the above example this means that given the bivectors not fix the sign of J. This is just as for the unit
a1 ∧ a2 and b1 ∧ b2 , representing two planes in their OPNS, pseudoscalar I, where we only demanded that its
the intersection of these planes in the OPNS is given by magnitude is unity, but we did not say anything
(a1 ∧ a2 ) O (b1 ∧ b2 ). about its sign. We will not discuss this problem
further apart from noting that it becomes irrelevant
Unfortunately, their is a problem. Let {e1 , e2 , e3 } again when working in projective spaces.
denote an orthonormal basis of R3 . Now suppose we wanted
We can now define the meet in terms of the join. Let
to find the intersection of a line represented by e2 and a plane
Ahki , Bhli ∈ G(Rn ) and let J = Ahki ∧B
˙ hli be their join. Then
represented by e2 ∧ e3 , through their OPNS. We see imme-
the meet of Ahki and Bhli is denoted by ∨ and defined as
diately that since e2 is also contained in the bivector e2 ∧ e3 , h¡ ¢ ¡ ¢i
the line is completely contained within the plane and thus Ahki ∨ Bhli := Ahki · J −1 ∧ Bhli · J −1 · J. (25)
their intersection should be the line e2 itself. However, the
regressive product gives In terms of sets this is
£ ¤ ¡ ¢ ¡ ¢ ¡ ¢
e2 O (e2 ∧ e3 ) = £e2 ∗ ∧ (e2 ∧ e3¤)∗ · I NO Ahki ∨ Bhli = NO Ahki ∩ NO Bhli .
= £(e1 ∧ e3 ) ∧ e1 · I¤
= − (e1 ∧ e1 ) ∧ e3 · I Note that the meet is only defined for blades and it be-
= 0, comes the regressive product, if the join is the pseudoscalar.
°
c The Eurographics Association 2004.
26 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 27
°
c The Eurographics Association 2004.
28 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
V
Since the reverse of a scalar is still the same scalar it follows means that given a blade Ahki = ki=1 ai , with {ai } ⊂ Rn ,
m n = (n m)˜. and a rotor R, we can expand the expression RAhki Re as
¡ ¢ ¡ ¢ ¡ ¢
Equation (32) may therefore also be written more succinctly R Ahki Re = R a1 Re ∧ R a2 Re ∧ . . . ∧ R ak Re . (37)
as Hence, the rotation of the outer product of a number of vec-
e
b = R a R, with R := m n. (33) tors is the same as the outer product of a number of rotated
vectors.
Since applying R as above has the effect of a rotation, R is
called a rotor. Note that a rotor has to satisfy the equation
13. Geometry
R Re = 1,
In the previous sections we first talked about Geometric Al-
because it would otherwise also scale the entity it is applied gebra and how elements of that algebra are taken to represent
to. We can actually recognize this as something familiar, by geometric entities. We also saw how we can operate on such
expanding R as entities in order to reflect or rotate them. In this section we
would like to return to the geometric interpretation of the
R = mn
algebra.
= m·n+m∧n (34)
= cos θ + sin θ Uh2i , Although we will talk in the following about spaces which
embed Euclidean space in some way, the basic meaning of
where θ = ∠(m, n) and Uh2i is the normalized version of blades as linear subspaces and the reflection operator remain
m ∧ n, ie the same within these spaces. However, their effect on the
m∧n embedded Euclidean space, or rather their interpretation in
Uh2i := .
km ∧ nk terms of the embedded Euclidean space may change quite
substantially.
From equation (15) we know that
We will denote the homogeneous embedding of Euclidean
Uh2i ·Uh2i = (−1)2(2−1)/2 kUh2i k2 = −1. space En by PEn . PEn is also called a projective space. The
Since Uh2i squares to −1, the expression for R in equation properties of PEn basically derive from the way Euclidean
(34) is similar to that of a complex number z in the polar space is embedded in it. The projective space PEn will be
representation represented by Rn+1 \ 0, ie a (n + 1)-dimensional vector
space without the origin. The canonical (orthonormal) basis
z = r (cos θ + i sin θ), of Rn+1 will be denoted by {e1 , . . . , en , en+1 }. The basis
√ vector en+1 is also called the homogeneous component or
where i = −1 represents the imaginary unit and r ∈ R is
the radius. For complex numbers it is well known that the dimension.
above expression can also be written as
13.1. The Setup
z = r exp(i θ).
The transformation operator from Euclidean to the corre-
The definition of the exponential function can be extended
sponding projective space will be denoted by P and its in-
to Geometric Algebra, and it can be shown that the Taylor
verse by P −1 . The operator P is defined as
series of exp(θ Uh2i ) does indeed converge to
¡ ¢ P : x ∈ En 7→ x + en+1 ∈ PEn . (38)
exp θ Uh2i = cos θ + sin θ Uh2i = R. (35)
That is, Euclidean space is embedded as a particular hyper-
It turns out that R = exp(θUh2i ) actually represents a clock- plane P(En ) in projective space. A vector in PEn will also
wise rotation by an angle 2θ in the plane Uh2i . The term be called a homogeneous vector. Note that the origin of Eu-
"clockwise" only makes really sense in 3d-space. Here it clidean space becomes en+1 in projective space. This means
∗
means clockwise relative to the rotation axis given by Uh2i . that the origin of Euclidean space, as represented in projec-
If we want to represent a mathematically positive, ie anti- tive space is not a special point any more. For example, while
clockwise, rotation about an angle θ, within the plane Uh2i , the scalar product of a vector with the origin in Euclidean
we need to write the corresponding rotor as space is always identically zero, this is not necessarily the
¡ ¢
R = exp − θ2 Uh2i . (36) case in projective space.
Figure 17 illustrates the embedding of Euclidean vectors
Just as for reflections, a rotor represents a rotation in any in projective space for the case of E2 . A vector a ∈ E2 from
dimension. A rotor can also rotate any blade. That is, with Euclidean space is embedded in projective space PE2 by
the same rotor we can rotate vectors, bivectors, etc. It turns adding the homogeneous dimension e3 . The homogeneous
out that for a rotor we also have an outer-morphism. This representation of a in PE2 is then denoted by A = P(a).
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 29
Figure 17: Embedding of Euclidean vector a ∈ E2 in pro- Figure 18: Projections of a homogeneous vector A ∈ PE2
jective space PE2 as A = P(a). into the corresponding Euclidean space E2 as a = P −1 (A).
Although Euclidean vectors are mapped to a hyperplane 13.2. Geometric Algebra on PEn
in projective space, a general homogeneous vector may lie
Recall that elements of Geometric Algebra are given geo-
anywhere in PEn ≡ Rn+1 \ 0. Therefore, the question is how
metric meaning by looking at their OPNS or IPNS, the outer
homogeneous vectors that do not lie on P(En ) are projected
or inner product null space. When we write down a blade,
back to En . This projection is in fact the key to the power of
its OPNS always represents a linear subspace. For example,
the homogeneous representation.
a bivector in PE2 is a two dimensional subspace, since we
The transformation from PEn to En is denoted by P −1 represent PE2 by R2+1 . However, we are not really inter-
and is defined as ested in what this bivector represents in PE2 . We would like
1 n ¡ ¢ to know what it represents in the corresponding E2 . How do
P −1 : A ∈ PEn 7→ ∑
A · en+1 i=1
A · ei ei ∈ En . (39) we do that? Well, we need to be more precise about which
null space we are actually interested in.
Clearly, this transformation is only valid for homogeneous
Given a bivector Ah2i ∈ G(PE2 ), we are only interested in
vectors that have a non-zero homogeneous component.
Those homogeneous vectors that do have a zero homoge- those vectors in PE2 that lie in one of its null spaces, which
neous component would map to infinity and are accordingly we can also map back to Euclidean space. The other way
called points at infinity or direction vectors. around: we ask which vectors in E2 when transformed to
PE2 lie in the null space of Ah2i . We therefore introduce the
Using the transformation P −1 the whole of PEn apart concept of the Euclidean outer and inner product null space,
from the plane en+1 = 0 is mapped to En . What does this denoted by NOE and NIE , respectively. For G(PEn ) they are
mean for a particular homogeneous vector? Well, the ho- defined as follows.
mogeneous vector is first scaled such that its homogeneous
component is unity, and then its first n components are taken
as the n components of the corresponding Euclidean vector. NOE (Ahki ∈ G(PEn ))
This is illustrated in figure 18. © ª
:= a ∈ En : P(a) ∧ Ahki = 0 ∈ G(PEn ) ,
The effect of P −1 is that the overall scale of a homo-
geneous vector in projective space is of no importance. For and NIE (Ahki ∈ G(PEn ))
© ª
example, given a vector a ∈ En and a scale α ∈ R \ 0, then := a ∈ En : P(a) · Ahki = 0 ∈ G(PEn ) .
³ ¡ ¢´ (40)
P −1 α P a = a.
Hence, the name "projective space": homogeneous vectors 13.3. The Euclidean OPNS
are projected onto the hyperplane P(En ) before they are "or-
So how can we evaluate the Euclidean IPNS or OPNS of a
thographically" projected into En . The hyperplane P(En ) is
blade in projective space? Consider, for example, a vector
also called the affine plane. Note that affine transformations
a ∈ En with homogeneous representation A = P(a) ∈ PEn .
are in fact just those that when applied to a point on P(En )
The OPNS of A is simply given by
leave the point on that plane. Projective transformations on © ª
the other may move points through the whole space PEn . NO(A) = α A ∈ PEn : α ∈ R \ 0 ,
°
c The Eurographics Association 2004.
30 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
a projective line in PEn . The factor α must not be zero since passes through the points a, b and c. To summarize, we have
the origin of Rn+1 is not an element of PEn . Since all el-
NOE (A) Point a
ements of NO(A) can be mapped to En by P −1 , we find
NOE (A ∧ B) Line through a and b
that
³ ´ NOE (A ∧ B ∧ C) Plane through a, b and c
NOE (A) = P −1 NO(A)
© ³ ´ ª 13.4. The Euclidean IPNS
= (αA)·e 1
∑ni=1 (αA) · ei ei : α ∈ R \ 0
© n+1
ª
= P −1 (A) : α ∈ R \ 0 We can also consider the Euclidean IPNS of blades of
= a. G(E3 ). We will do this in some detail for a homogeneous
vector. Let A ∈ PE3 be given by
This shows that even though the OPNS of A is a (projective)
line in PEn , the Euclidean OPNS of A is only the vector A = â − α eo ,
a ∈ En . This is great, since it enables us to represent a zero- where â ∈ E and kâk = 1. Furthermore, α ∈ R and eo de-
3
dimensional object, ie a point, in En by a line in PEn . notes the homogeneous dimension e3+1 , in order to empha-
An example of this has already been shown for the case size its meaning as the vector in PE3 representing the origin
of E2 in figure 18. All points in PE2 along the line from, but of En . Let us now try to evaluate the Euclidean IPNS of A.
excluding, the origin of PE2 to the homogeneous vector A, That is, we are looking for all those vectors x ∈ E3 that sat-
represent the same point a in E2 . isfy A · P(x) = 0.
A · P(x) = 0 ⇐⇒ (â − α eo ) · (x + eo ) = 0
⇐⇒ â · x − α = 0
⇐⇒ â · xk − α = 0
⇐⇒ xk = α â,
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 31
°
c The Eurographics Association 2004.
32 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 33
PART FOUR
°
c The Eurographics Association 2004.
34 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
with V being a so-called versor and with Ve as its reverse. SetMode(N3_IPNS, N3_SOLID);
:Red;
:a = VecN3(0,-2,0);
:b = VecN3(0,2,0);
15.1. Rotors
:Green;
For rotations, the operator axis = *(a^b^einf);
φ :axis;
R = e− 2 l (42) axis=axis/abs(axis);
describes a so-called rotor. ?axis;
l is the rotation axis represented by a normalized bivector The bivector representing the rotation axis is computed as
and φ is the rotation angle around this axis. before and normalized with help of the abs-function.
R can also be written as
φ φ :Yellow;
R = cos( ) − lsin( ) (43) :Sun = e0 -0.5*einf;
2 2
The rotation of a geometric object a is performed with help :Red;
of the operation :Earth =VecN3(2,0,0)-0.125*einf;
e
arotated = R a R.
?R = exp(-angle/2*axis);
Note : Re is the reverse of R.
:Blue;
:R * Earth * ~R;
In the following CLUScript example Rotor.clu we will
rotate the sphere Earth around the sphere Sun located at the
origin. Sun is centered at the origin e0 with radius r = 1 ( see table
6 ). It is drawn as a yellow sphere.
The red sphere is used as the basis sphere for the rotation of
Earth. It is located out of the origin with half the radius of
Sun.
The blue sphere representing the earth is rotated with help of
the product R Earth R. e
The rotation operator depends on the fixed axis and the con-
tinuously changing angle.
15.2. Translators
In Conformal Geometric Algebra, translations can be ex-
pressed in a multiplicative way with help of translators T
defined by
e∞ t
T =e 2 (44)
where t is an inhomogenous vector
t = t1 e1 + t2 e2 + t3 e3
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 35
Proof : :a=VecN3(0,-2,0);
With help of the Taylor series :b=VecN3(0,2,0);
e∞ t
e∞ t
2 ( e∞ t 2
2 ) ( e∞ t )3 :Green;
T =e 2 = 1+ + + 2 ...
1! 2! 3! axis = *(a^b^einf);
:axis;
Since (e∞ )2 = 0 axis=axis/abs(axis);
e∞ t ?axis;
T = 1+
2
. :Yellow;
:Sun = e0 -0.5*einf;
:Red;
:Earth=VecN3(2,0,0)-0.125*einf;
e
arigid_body_motion = M a M.
The sun is drawn as a yellow sphere.
In the CLUScript example RigidBody.clu we will per- The red sphere is the basis for the rigid body motion of the
earth.
The green sphere shows only the translation part of the mo-
tion. In this example it is a translation in the direction of e2
dependent on the angle of the rotation.
The blue sphere is rotated and translated with help of the
geometric product Motor Earth Motor. ^
°
c The Eurographics Association 2004.
36 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
...
PHI1 = 1;
d1=-0.7;
M1 = d1*d1_vec;
?Twist1 = -PHI1 / 2*(L1+einf*M1);
Motor1 = exp(Twist1);
:Green;
:Motor1* Earth1 * ~Motor1;
PHI2 =Pi/2;
d2=-0.1;
M2 = d2*d2_vec;
?Twist2 = -PHI2/2*(L2+einf*M2);
Motor2 = exp(Twist2);
Figure 26: Screw motion along l
:Magenta;
:Motor2* Earth1 * ~Motor2;
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 37
computeRotation = {
// evaluate the rotor dependend on
// _P(1) : the direction of rotation
// _P(2) : the angle
if (_P(1) ==0) {
::Rot = RotorN3(1,0,0, _P(2));
}
else {
...
}
}
°
c The Eurographics Association 2004.
38 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
zt = St^PIt;
PI1 = *(ly_dual^p2);
Since the gripper also has to lie in the orientation plane PIt , Pp0 = *(z0^PI1);
we have to intersect it with St . The result is the circle zt . // choose one of the two points
p0 = DissectSecond(Pp0);
jz_dual = zt^einf;
ly_dual=e0 ^ e2 ^ einf; The intersection with plane PI1 delivers a point pair Pp0 .
ly =*ly_dual; Again, we choose the second one.
l_proj = proj(pt,ly_dual);
18.3. Step 3
ld_dual = l_proj ^ pt ^ einf;
ld=*ld_dual;
p0 is the location of the first joint. It rotates on a circle in Computing this point is usually a difficult task because it is
height h with radius r. the intersection of two circles. However, using Conformal
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 39
In the fourth step all the planes and lines, that are needed
for the computation of the angles of the joints are calculated.
PI3_DUAL = p1 ^ p2 ^ pt ^einf;
PI2_DUAL = e3 * I;
PI1_DUAL = *PI1;
l1_dual = p0^p1^einf;
l2_dual = p1^p2^einf;
l3_dual = p2 ^ pt ^ einf;
angle(1)=
Pi/2-computeAngle(PI1_DUAL, PI2_DUAL);
angle(2)=
-computeAngle(l1_dual, ly_dual);
angle(3)=
computeAngle(l1_dual,l2_dual);
angle(5)=
Pi-computeAngle(PI1_DUAL,PI3_DUAL);
angle(4) = -
computeAngle(l2_dual, l3_dual);
°
c The Eurographics Association 2004.
40 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
PART FIVE
scalars point pairs free vectors
5D pseudoscalar circles free bivectors
Implementation and Performance of the point at infinity spheres free trivectors
Geometric Algebra points flat points tangent vectors
lines tangent bivectors
planes tangent trivectors
Daniel Fontijne & Leo Dorst
Table 7: Blades in the conformal model. See [Dor03] for a
formal classification of these blades.
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 41
°
c The Eurographics Association 2004.
42 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
+As +A1 +A2 +A3 −A12 −A13 −A23 −A123
+A1 +As +A12 +A13 −A2 −A3 −A123 −A23
+A2 −A12 +As +A23 +A1 +A123 −A3 +A13
+A3 −A13 −A23 +As −A123 +A1 +A2 −A12
[A ] =
G
+A12 −A2 +A1 +A123 +As +A23 −A13 +A3
+A13 −A3 −A123 +A1 −A23 +As +A12 −A2
+A23 +A123 −A3 +A2 +A13 −A12 +As +A1
+A123 +A23 −A13 +A12 +A3 −A2 +A1 +As
Figure 34: Geometric product matrix for 3D Euclidean multivector A. Notation: A12 is coordinate A that refers to e1 ∧ e2 .
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 43
°
c The Eurographics Association 2004.
44 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
ear algebra, Geometric Algebra and tensor algebra directly, Current graphics processors (GPUs) do have zero-cost
or at least seamlessly. swizzle-negate hardware and thus are a great target for doing
fast Geometric Algebra computations. Geometric Algebra
could easily be integrated into high level shading languages.
22.5. Summary Pro / Cons of the approaches
It could also be used in compilers that intend to use GPUs as
• Matrix based general purpose processors (e.g. BrookGPU, see[BFH∗ 02])
– pro: simple. The conformal model seems to be especially fit for hard-
– con: slow. ware implementation. It is by nature more parallel than the
traditional way of doing geometric computations. For in-
• Run time configurable
stance, the code in figure 33 could theoretically execute in
– pro: versatile, can be implemented in most languages. three cycles (multiply, add, add). However, this would re-
– con: not very efficient. quire very wide SIMD hardware and fast memory access to
get the 10 coordinates of the circle and the 5 coordinates of
• Code generation (like Gaigen)
the sphere into the processor in time.
– pro: very efficient, can be implemented in many lan-
guages. With built-in language can get precedence of
operators right. 24. Performance and Elegance of Five Models of
– con: requires PGO, requires separate program (the Geometry in a Ray Tracing Application
code generator). Building a code generator takes a lot
of time. Computations of 3D Euclidean geometry can be performed
using various computational models of different effective-
• Code generation (meta programming) ness. We decided to compare five alternatives, from plain
– pro: very efficient, requires no extra tools. old 3D linear algebra to the 5D conformal model using Ge-
– con: limited to few languages (and sturdy compilers), ometric Algebra. We wanted to compare them not just theo-
long compile times. Hard to implement and debug. retically, but by showing how you would implement a simple
recursive ray tracer in each of them. The project was meant
• Direct integration into programming language as a tangible case study of the profitability of choosing an
– pro: optimally efficient, gets precedence of operators appropriate model, investigating the trade-offs between ele-
right. gance and performance for this particular application.
– con: compiler extensions required. This section is a summary of the full paper [FD03] and
more information and source code can be downloaded at
23. Geometric Algebra Hardware [FD02].
Little research has been done on implementing Geometric The models we compare are: 3D linear algebra (3D LA);
Algebra directly into hardware. The only research known to 3D Geometric Algebra (3D GA, which naturally absorbs the
us is [PGS03]. A field programmable gate array (FPGA) was quaternions into 3D real geometry); 4D linear algebra (4D
used as co-processor that can compute geometric products. LA, i.e. the familiar homogeneous coordinates extended with
Central to the design was a basis blade pipeline that could Plücker coordinates); the 4D homogeneous model (4D GA, a
compute geometric products for individual basis blades. The Geometric Algebra which naturally absorbs Plücker coordi-
results of these were summed afterwards. Multiple basis nates of lines and planes into homogeneous computations);
blade pipelines could be used in parallel, but due to hardware and the 5D conformal model (5D GA). We picked both 3D
limitations, only one pipeline could be implemented on the LA and 4D LA because we wanted a basic and an advanced
FPGA. Benchmarks indicated that the single pipeline ver- mainstream model as baseline. We selected 3D GA and 4D
sion is about as fast as Gaigen, given that the FPGA would GA because they are the (improved) GA variants of the 3D
operate at the same clockspeed as the CPU that Gaigen ran LA and 4D LA models. The 5D GA model is used to demon-
on. strate what kind of improvements are possible with more so-
phisticated models.
Another approach to hardware implementation could be
SIMD instructions fit for doing Geometric Algebra. How- Our reasons for choosing a ray tracer as benchmark are
ever, the low level code for computing the products from the following. 1) Everybody familiar with computer graph-
Geometric Algebra resemble traditional cross products (or ics knows how a basic ray tracer works, and possibly has
computing (sub-)determinants, if you will). CPU SIMD in- implemented one. 2) Implementing the core of a ray tracer
struction sets (such as Intels SSE) are designed mostly for can be done with relatively little code, which was important
matrix-vector multiplications. They lack efficient ’swizzle- to us, since we were going to write many different imple-
negate’ hardware that enables computing these products ef- mentations of the same algorithm. 3) A ray tracer contains
ficiently. a diverse selection of geometric computations, like rotation,
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 45
3D LA 3D GA 4D LA 4D GA 5D GA
Figure 35: The same result can be achi eved in many ways. These images are identical, but each one was rendered using a differ-
ent model of 3D Euclidean geometry. The scene consist of 5 objects modeled with about 7800 triangles: a textured/bumpmapped
teapot, a transparent drinking glass, a reflective sphere , a red diffuse sphere, and a textured/bumpmapped piece of wood.
model implementation rendering time executable size run time memory usage
Table 10: Performance benchmarks run on a Pentium III 700 MHz notebook, with 256 MB memory, running Windows 2000.
Programs were compiled using Visual C++ 6.0. All support libraries, such as fltk, libpng and libz were linked dynamically to
get the executable size as small as possible. Run time memory usage was measured using the task manager.
3D LA 3D GA 4D LA 4D GA 5D GA
Figure 36: Summary of the representation of a line and the intersection of a line and a plane in 5 models of Euclidean Geometry.
See the full matrix at [FD02].
°
c The Eurographics Association 2004.
46 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
translation, reflection, refraction, (signed) distance compu- Investment in development of advanced implementations
tation, and line-plane and line-sphere intersection computa- such as programming languages directly supporting GA or
tions. This allows us to show by example how to perform special GA hardware may depend on the invention of some
these computations in different models. But we emphasize (profitable) ’killer applications’ that are only possible using
that our main goal was to compare frameworks for represen- GA.
tation and computation of geometry in some practical situa-
tion, not to build a ray tracer per se. The resulting ray tracer
is not a marvel of contemporary computer graphics; yet it is
sufficiently sophisticated to render images such as figure 35.
Table 10 gives benchmarks for the 5 ray tracer implemen-
tations (+3 extra where CLU was used instead of Gaigen).
Our conclusions as far as performance goes were the follow-
ing:
• More refined models of geometry are less efficient. The
conformal model is about 2.5× slower than 3D GA. The
penalty for the 4D models was less severe.
• Gaigen is not as efficient as hand coded linear algebra.
Since 3D GA and 3D LA use (on a low level) the same
operations, the 1.86× slowdown of 3D GA is entirely due
to Gaigen.
• If we assume that we could improve Gaigen to match the
performance of 3D LA for the 3D GA case, then we can
extrapolate that, without further optimizations, the confor-
mal model should be about 2.5× slower than 3D LA.
• CLU is a far from optimally efficient GA implementation
(both in processing time and memory).
On the elegance side of the equation we see great im-
provements by using more refined models. Figure 36 shows
an two examples. The top example shows how a line is rep-
resented in each of the 5 models. In 3D LA and 3D GA the
line is represented in terms of two separate vectors. The 4D
models improve on this by having a separate primitive for
representing lines, although 4D LA lacks the ability to ex-
press this in a coordinate free way. 5D GA generalizes the
line representation in a way that also allows for circles.
The bottom example in figure 36 shows the improve-
ments for the computing the intersection point of a line and a
plane. The computations in the 3D models are basically the
same, and quite involved. Both 4D models compute the same
thing, but again the speech impediment of 4D LA/Plücker
coordinates leads to an involved equation. 5D GA general-
izes the equation of 4D GA so it works on line/circles and
planes/spheres.
25. Conclusion
GA implementation is still in a state of flux. There is no sin-
gle do-it-all implementation that is easy to use, optimally ef-
ficient and available in several programming languages, all
at the same time.
However, we have shown that GA is usable right now for
developing computer graphics applications by implementing
a ray tracer using GA. Performance may still lack somewhat,
but will no doubt improve in coming years.
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 47
°
c The Eurographics Association 2004.
48 D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial
[LL98] L ASENBY J., L ASENBY A. N.: Estimating Ten- (Ed.), The University of Auckland, pp. 157–162.
sors for Matching over Multiple Views. Phil. 31
Trans. R. Soc. Lond. A 356, 1740 (1998), 1267–
[PL01] P ERWASS C., L ASENBY J.: A Unified Descrip-
1282. 18, 31
tion of Multiple View Geometry. In Geometric
[Lou87] L OUNESTO P.: The CLICAL home page. Computing with Clifford Algebra (2001), Som-
HTML document, 1987. Last visited 15. Sept. mer G., (Ed.), Springer-Verlag. 6, 18, 31
2003. 18
[Por95] P ORTEOUS I. R.: Clifford Algebras and the
[Lou97] L OUNESTO P.: Clifford Algebras and Spinors. Classical Groups. Cambridge University Press,
Cambridge University Press, 1997. 18 1995. 18
[Mac99] M AC D ONALD A.: Elementary Construction [Rie93] R IESZ M.: Clifford Numbers and Spinors.
of the Geometric Algebra. In Proceedings 5th Kluwer Academic Publishers, 1993. 18
International Conference on Clifford Algebras [Ros03] ROSENHAHN B.: Pose Estimation Revisited.
and their Applications in Mathematical Physics PhD thesis, Inst. f. Informatik u. Prakt. Math. der
(1999). To be published. 18 Christian-Albrechts-Universit"at zu Kiel, 2003.
[MD02] M ANN S., D ORST L.: Geometric algebra: a 36
computational framework for geometrical appli- [Sel96] S ELIG J. M.: Geometrical Methods in Robotics.
cations (part ii: applications). Computer Graph- Springer–Verlag, 1996. 18
ics and Application 22, 4 (July/August 2002),
58–67. 8 [Som01] S OMMER G. (Ed.): Geometric Computing with
Clifford Algebra. Springer Verlag, 2001. 18
[MDB01] M ANN S., D ORST L., B OUMA T.: The mak-
ing of GABLE, a geometric algebra learning en- [Sut03] S UTER J.: Clifford. Used to be available at
vironment in matlab. Geometric Algebra with http://www.jaapsuter.com (2003). 40, 43
Applications in Science and Engineering (2001), [VJ02] VANDEVOORDE D., J OSUTTIS N. M.: C++
491–511. 18, 33, 40, 41 templates: The complete guide. Addison-Wesley
[MR02] M ANN S., ROCKWOOD A.: Computing singu- (2002). 43
larities of 3d vector fields with geometric alge- [ZD03] Z AHARIA M., D ORST L.: Interface specifica-
bra. Proceedings of the conference on Visualiza- tion and implementation internals of a program
tion ’02 (2002), 283–290. 41 module for geometric algebra. Accepted for
[Per00] P ERWASS C.: Applications of Geometric Alge- Journal of Logic and Algebraic Programming
bra in Computer Vision. PhD thesis, Cambridge (2003). todo todo todo see website. 40, 42
Universtiy, 2000. 18, 31
[Per02] P ERWASS C.: The CLU home page. HTML
document, 2002. Last visited 28. May 2004. 18,
33, 40, 42
[PGS03] P ERWASS C., G EBKEN C., S OMMER G.: Im-
plementation of a clifford algebra co-processor
design on a field programmable gate array.
CLIFFORD ALGEBRAS: Application to Math-
ematics, Physics, and Engineering (2003), 561–
575. 42, 44
[PH03] P ERWASS C., H ILDENBRAND D.: Aspects of
Geometric Algebra in Euclidean, Projective and
Conformal Space. Technical Report Number
0310, Christian-Albrechts-Universität zu Kiel,
Institut für Informatik und Praktische Mathe-
matik, September 2003. 18, 30, 33
[PL98] P ERWASS C., L ASENBY J.: A Geometric Anal-
ysis of the Trifocal Tensor. In Image and Vi-
sion Computing New Zealand, IVCNZ’98, Pro-
ceedings (1998), R. Klette G. Gimel’farb R. K.,
°
c The Eurographics Association 2004.
D. Hildenbrand, D. Fontijne, C. Perwass, L. Dorst / Geometric Algebra Tutorial 49
26.3. D. Hildenbrand
Dietmar Hildenbrand
University of Technology Darmstadt, Germany
Fraunhoferstr. 5
64283 Darmstadt
email:[email protected]
Phone: +49 6151 155 667
Fax: +49 6151 155 669
URL:http://www.dgm.informatik.tu-
darmstadt.de/staff/dietmar/
°
c The Eurographics Association 2004.