Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Geometric Algebra: A Computational Framework For Geometrical Applications

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

Feature Tutorial

Geometric Algebra:
A Computational
Framework For
Geometrical
Applications Stephen Mann
University of Waterloo

Leo Dorst
Part 2 University of Amsterdam

T his is the second of a two-part tutorial on


geometric algebra. In part one,1 we intro-
duced blades, a computational algebraic representa-
defines a rotation/dilation operator. Let us do a slight-
ly simpler problem. In Figure 1a, if a and b have the
same norm, what is the vector x in the (a ∧ b) plane that
tion of oriented subspaces, which are the basic elements is to c as the vector b is to a? Geometric algebra phras-
of computation in geometric algebra. We also looked es this as x c–1 = b a–1 and solves it (see Equation 13
at the geometric product and two products derived from part one1) as
from it, the inner and outer products. A crucial feature

( )
of the geometric product is that it is invertible.
From that first article, you should x = ba−1 c =
1
2
( b ⋅ a + b ∧ a) c
have gathered that every vector a
This second part of our space with an inner product has a
b
tutorial uses geometric
geometric algebra, whether or not
you choose to use it. This article
=
a
(cos φ − Isin φ) c = e −Iφ
c (1)

shows how to call on this structure


algebra to represent to define common geometrical con- Here Iφ is the angle in the I plane from a to b, so –Iφ is
structs, ensuring a consistent com- the angle from b to a. Figure 1a suggests that we obtain
rotations, intersections, and putational framework. The goal is to x from c by a rotation, so we should apparently inter-
show you that this can be done and pret premultiplying by e–Iφ as a rotation operator in the
differentiation. We show that it is compact, directly computa- I plane.
tional, and transcends the dimen- The vector c in the I plane anticommutes with I: c I =
how a small set of products sionality of subspaces. We will not –I c—showing that I is not merely a complex number,
use geometric algebra to develop even though I2 = –1. Using this to switch I and c in Equa-
simplifies many geometrical new algorithms for graphics, but we tion 1, we obtain that the rotation is alternatively repre-
hope to convince you that you can sentable as a postmultiplication:
operations. automatically take care some of the
lower level algorithmic aspects,
e−Iφ c = c cos φ − Ic sin φ
without tricks, exceptions, or hidden degenerate cases
by using geometric algebra as a language. = c cos φ + cI sin φ = ceIφ (2)

Rotations What is cI? First, temporarily introduce orthonormal


Geometric algebra handles rotations of general sub- coordinates {e1, e2} in the I plane, with e1 along c, so
spaces in Vm through an interesting sandwiching prod- that c ≡ ce1. Then, I = e1 ∧ e2 = e1 e2. Therefore, cI =
uct using geometric products. We introduce this ce1e1e2= ce2—it is c turned over a right angle, following
construction gradually. the orientation of the 2-blade I (here anticlockwise). So
c cosφ + cI sinφ is “a bit of c plus a bit of its anticlock-
Rotations in 2D wise perpendicular,” and those amounts are precisely
In the last article, we saw that the ratio of vectors right to make it equal to the rotation by φ (see Figure 1b).

58 July/August 2002 0272-1716/02/$17.00 © 2002 IEEE


Angles as geometrical objects I-plane I-plane
x cI
In Equation 1, the combination Iφ is a full indication 1 (a) The rota-
of the angle between the two vectors. It denotes not only c Rc = e−Iφ c = ceIφ tion operator as
the magnitude but also the plane in which the angle is a ratio between
measured and even the angle’s orientation. If you ask vectors. (b)
c
for the scalar magnitude of Iφ in the plane –I (the plane Coordinate-free
b
from b to a rather than from a to b), it is –φ. Therefore, specification of
the scalar value of the angle automatically gets the right a rotation.
(a) (b)
sign. The fact that the angle as expressed by Iφ is now a
geometrical quantity independent of the convention
used in its definition removes a major headache from
many geometrical computations involving angles. We over π/2, we write out their rotors (using the shorthand
call this true geometric quantity the bivector angle. (It is e23 = e2 ∧ e3 = e2 e3 and so on):
just a 2-blade, of course, and not a new kind of element,
but we use it as an angle, hence the name). 1 − e23
R1 = e−I3e1π / 4 =
Rotations in m dimensions 2
Equation 2 rotates only within the plane I. Generally,
we would like to have rotations in space. For a vector x, and
the outcome of a rotation RIφ should be 1 − e31
R2 = e−I3e2π / 4 =
RIφ x = x⊥ + RIφ x|| 2

where x⊥ and x|| are the perpendicular and parallel com- The total rotor is their product, and we rewrite it back to
ponents of x relative to the rotation plane I, respective- the exponential form to find the axis:
ly. We have seen that we can separate a vector into such
components by commutation (as in Equations 31 and 32
from part one1). As you can verify, the following formu-
R ≡ R2 R1 =
1
2
(
1 − e31 1 − e23 )( )
la effects this separation and rotation simultaneously: 1
(
= 1 − e23 − e31 + e12
2
)
rotation over Iφ: x a RIφx = e–Iφ/2x eIφ/2 (3) 1 1 e + e − e3
= − 3 I3 1 2
2 2 3
The operator e–Iφ/2, used in this way, is called a rotor.
In the 2D rotation we treated before, x I = –I x, and ≡ e−I3aπ /3
moving either rotor to the other side of x retrieves Equa-
tion 2 if x is in the I plane. Therefore, the total rotation is over the axis a=(e1+
Two successive rotations R1 and R2 are equivalent to 3, over the angle 2π/3.
e2 – e3)/√
a single new rotation R of which the rotor R is the geo- Geometric algebra permits straightforward general-
metric product of the rotors R2 and R1, since ization to the rotation of higher dimensional subspaces.
We can apply a rotor immediately to an arbitrary blade
(R o R )x = R ( R x R ) R
2 1 2 1
−1
1
−1
2 through the formula

= (R R ) x (R R )
−1
2 1 2 1 = R x R −1 general rotation: X a R X R–1

This lets you rotate a plane in one operation, for instance,


with R = R2R1. Therefore, the combination of rotations using a rotation by R (as in the example we just saw):
is a simple consequence of the application of the geo-
metric product on rotors—that is, elements of the form
e–Iφ/2 = cos (φ/2) – I sin (φ/2), with I2 = –1. This is true ( )
R e1 ∧ e2 R −1 =
in any dimension greater than 1 (and even in dimension
1, if you realize that any bivector there is zero, so that
1
4
( ) (
1 − e23 − e31 + e12 e12 1 + e23 + e31 − e12 = − e31 )
rotations do not exist).
Let us see how it works in 3-space. In three dimensions,
we are used to specifying rotations by a rotation axis a There is no need to decompose the plane into its span-
rather than by a rotation plane I. Given a unit vector a for ning vectors first.
an axis, we find the plane as the 2-blade complementary
to it in the 3D space with volume element I3: I = Quaternions based on bivectors
a  I3 = aI3 = I3a. A rotation over an angle φ around an You might have recognized the last example as strong-
axis with unit vector a is therefore represented by the ly similar to quaternion computations. Quaternions are
rotor e–I3aφ/2. indeed part of geometric algebra in the following
For example, to compose a rotation R1 around the e1 straightforward manner.
axis of π/2 with a subsequent rotation R2 over the e2 axis Choose an orthonormal basis {ei}3i=1. Construct out

IEEE Computer Graphics and Applications 59


Feature Tutorial

b ≡ B* Note that this is grade preserving—a k-blade transforms


I3 a^B a
a to a k-blade. We supplement this by stating what the
extension does to scalars, which is simply f(α) = α. Geo-
b×a aB metrically, this means that a linear transformation
leaves the origin intact.
Linear transformations are outermorphisms, which
explains why we can generalize so many operations
B B from vectors to general subspaces in a straightforward
manner.
(a) (b)
Dual representation
2 (a) The dual B* of a bivector B and the cross product with a. (b) The Linear algebra often uses dual representations of
same result using the inner product of blades (from part one1). hyperplanes to extend the scope of vector-based opera-
tions. In geometric algebra, dualization is also impor-
tant and in fact is a flexible tool to convert between
of that a bivector basis {e12, e23, e31}. Note that these viewpoints of spanning and perpendicularity, for arbi-
2
elements satisfy e12 =e223=e231=−1, e12 e23 = e31 (and trary subspaces.
cyclic), and also e12 e23 e31 = 1. In fact, setting i ≡ e23, Consider an m-dimensional space Vm and a blade A
j ≡ –e31, and k ≡ e12, we find i2 = j2 = k2 = i j k = –1 and in it. The dual of the blade A in Vm is its complement,
j i = k and cyclic. Algebraically, these objects form a basis definable using the contraction inner product:
for quaternions obeying the quaternion product, com-
monly interpreted as some kind of 4D complex number A ∗ = A  ˜I m
system. To us, there is nothing complex about quater-
nions, but they are not vectors either—they are real 2- where Im is the pseudoscalar of Vm (an m-blade giving
blades in 3-space, denoting elementary rotation planes the volume element) and ~⋅ is the reversion (obtained by
and multiplying through the geometric product. There- reversing the factors of the blade it is applied to and lead-
fore, visualizing quaternions is straightforward; each is ing to a grade-dependent sign change).
a rotation plane with a rotation angle, and the bivector The characterization of a subspace by a dual blade
angle concept represents that well. rather than by a blade enables manipulation of expres-
Of course, in geometric algebra, we can combine sions involving spanning to being about perpendicular-
quaternions directly with vectors and other subspaces. ity and vice versa. A familiar example in a 3D Euclidean
In that algebraic combination, they are not merely a space is the dual of a 2-blade (or bivector). Using an
form of complex scalars; quaternion products are nei- orthonormal basis {ei}3i=1 and the corresponding bivec-
ther fully commutative nor fully anticommutative (for tor basis, we write B = b1e2 ∧ e3 + b2e3 ∧ e1 + b3e1 ∧ e2.
example, i e1 = e1 i, but i e2 = –e2 i). It all depends on We take the dual relative to the space with volume ele-
the relative attitude of the vectors and quaternions, and ment I3 ≡ e1 ∧ e2 ∧ e3 (that is, the right-handed volume
these rules are precisely right to make Equation 3 be the formed by using a right-handed basis). The subspace of
rotation of a vector. I3 dual to B is then

Linear algebra B ˜I 3 =
In the classical ways of using vector spaces, linear
algebra is an important tool. In geometric algebra, this ( ) (
= b1e2 ∧ e3 + b2 e3 ∧ e1 + b3e1 ∧ e2  e3 ∧ e2 ∧ e1 )
remains true; linear transformations are of interest in = b1e1 + b2 e2 + b3e3 (5)
their own right or as first order approximations to
more complicated mappings. Indeed, linear algebra is This is a vector, and we recognize it (in this Euclidean
an integral part of geometric algebra, and it acquires space) as the normal vector to the planar subspace
much extended coordinate-free methods through this represented by B (see Figure 2b). So we have normal
inclusion. We show some of the basic principles in this vectors in geometric algebra as the duals of 2-blades,
article, but you can find more in related literature.2,3 if we would want them—but we will soon see a better
alternative.
Outermorphisms We can use either a blade or its dual to represent a
When vectors are transformed by a linear transfor- subspace, and it is convenient to have some terminolo-
mation on the vector space, the blades they span can be gy. We will say that a blade B represents a subspace B if
viewed to transform as well, simply by the rule “the
transform of a span of vectors is the span of the trans- x∈B ⇔ x∧B=0 (6)
formed vectors.” This means that a linear transforma-
tion f: Vm → Vm of a vector space has a natural extension and that a blade B* dually represents the subspace B if
to the whole geometric algebra of that vector space, as
an outermorphism—that is, as a mapping that preserves x ∈ B ⇔ x  B* = 0 (7)
the outer product structure:
We switch between the two standpoints by using the dis-
f(a1 ∧ a2 ∧ … ∧ ak) ≡ f(a1) ∧ f(a2) ∧ … ∧ f(ak) (4) tributive relation (A ∧ B)  C = A  (B  C) (which is Equa-

60 July/August 2002
tion 19 from part one1) used for a vector x, a blade B, ermorphism of the linear mapping defined for vectors
-
and a pseudoscalar I: by f(a)⋅b=a⋅f(b)—its matrix representation on vectors
would be the transpose.
( x ∧ B ) ˜I = x (B ˜I ) (8) Because of the complexity of this transformation
behavior, we should steer clear of any constructions that
and by a converse (but conditional) relationship that we involve the inner product, especially when characteriz-
state without proof ing basic properties of geometric objects. The practice of
characterizing a plane by its normal vector—which con-
( x B ) ˜I = x ∧ (B ˜I ) if x ∧ I = 0 (9) tains the inner product in its duality—should be avoid-
ed. Under linear transformations, the normal vector of
If x is known to be in the subspace of I, we can write a transformed plane is not the transform of the plane’s
these simply as (x ∧ B)* = x  B* and (x  B)* = x ∧ B*, normal vector. (This is a well-known fact, but it is always
which makes the equivalence of the two representations a shock to novices.) Rather, the normal vector is a cross
obvious. product of vectors, which transforms as

Cross product ( ) () ( ) ()
f a × b = f −1 a × f −1 b det f (11)
Classical computations with vectors in 3-space
often use the cross product ×, which produces from where det(f) is the determinant defined by
two vectors a and b a new vector a × b perpendicular det(f)=f(Im)I−1m. (This is a coordinate-free definition
to both (by the right-hand rule), proportional to the of the determinant of the matrix representation of f.)
area they span. We can make this in geometric alge- The right-hand side of Equation 11 is usually not
bra as the dual of the 2-blade spanned by the vectors equal to f(a) × f(b), so a linear transformation is not
(see Figure 2b): cross-product preserving. Therefore, it is much bet-
ter to characterize the plane by a 2-blade, now that
 ∗
we can. The 2-blade of the transformed plane is the
( )
a × b ≡ a ∧ b  ˜I 3 ( )
= a ∧ b 
 
(10) transform of the 2-blade of the plane because linear
transformations are outermorphisms preserving the
2-blade construction. Especially when the planes are
You can verify that computing this explicitly using Equa- tangent planes constructed by differentiation, 2-
tion 1 from part one1 and Equation 5 indeed retrieves blades are appropriate. Under any transformation f,
the usual expression a × b = (a2b3 – a3b2)e1 + (a3b1 – the construction of the tangent plane depends only
a1b3)e2 + (a1b2 – a2b1)e3. on the first-order linear approximation mapping f of
Equation 10 explicitly shows several things that we f. Using blades for those tangent spaces should enor-
always need to remember about the cross product: mously simplify the treatment of objects through dif-
ferential geometry, especially in the context of affine
■ there is a convention involved on handedness (this is transformations.
coded in the sign of I3),
■ there are metric aspects because it is perpendicular Intersecting subspaces
to a plane (this is coded in the usage of the inner prod- Geometric algebra also contains operations to deter-
uct  ), and mine the union and intersection of subspaces. These are
■ the construction only works in three dimensions the Join and Meet operations. Several notations exist for
because only then is the dual of a 2-blade a vector these in the related literature, causing some confusion.
(this is coded in the 3-gradedness of I3). In this article, we will use the set notations ∪ and ∩ to
make the formulas more easily readable.
The vector product a ∧ b does not depend on any of The Join of two subspaces is their smallest super-
these embedding properties yet characterizes the (a, b) space—that is, the smallest space containing them
plane just as well. In geometric algebra, we therefore both. Representing the spaces by blades A and B, the
have the possibility of replacing the cross product by a Join is denoted A ∪ B. If the subspaces of A and B are
more elementary construction. Linear algebra gives a disjoint, their Join is obviously proportional to A ∧ B.
good reason for doing so. A problem is that if A and B are not disjoint (which is
precisely the case we are interested in), then A ∪ B
No normal vectors or cross products contains an unknown scaling factor that is funda-
The transformation of an inner product under a lin- mentally unresolvable due to the blades’ reshapable
ear mapping is more involved than that of the outer prod- nature (see Figure 3). (Stolfi4 also observed this
uct in Equation 4 because perpendicularity is a more ambiguity.) Fortunately, in all geometrically relevant
complicated concept to transform than spanning. entities that we compute, it appears that this scalar
Hestenes3 gives the general transformation formula. For ambiguity cancels out.
blades, it becomes The Join is a more complicated product of sub-
spaces than the outer product and inner product. We
( ) ( ) ( )
f A  B = f −1 A  f B can give no simple formula for the grade of the result
and cannot characterize it with a list of algebraic
-
where f is the adjoint, defined as the extension of an out- computation rules. Although computation of the Join

IEEE Computer Graphics and Applications 61


Feature Tutorial

B = e1 ∧ e2. (We have normalized them so that


J AÃ=1=B B̃; it gives the Meet of these blades a numer-
B ical factor that we can interpret geometrically.) These
are planes in general position in 3D space, so their Join
is proportional to I3. It makes sense to take J = I3. For the
M
3 The ambiguity of scale for Meet Meet, this gives
M and Join J of two blades A and B. A
Both figures are acceptable solu-
A ∩B =
tions to the problem of finding a
((e ∧ e ) (e )) ((e + e ) ∧ (e ))
B 1
blade representing the union and J = ∧ e 2 ∧ e1  + e3
1 2 3 1 2 2
intersection of the subspaces of the 2
blades A and B.
M A
=
1
2
e3  ((e + e ) ∧ e )
1 2 3

1  e1 + e 2 
=−
1
(e + e ) = −
1 2



 (14)
2 2 2 

We have expressed the result in normalized form. The


e3
numerical factor for the resulting blade is in fact the sine
of the angle between the arguments. Figure 4 illustrates
the answer. As in Stolfi,4 the sign of A ∩ B is the right-
A
hand rule applied to the turn required to make A coin-
A∩B
cide with B, in the correct orientation.
4 An example Classically, we usually compute the intersection of
of the Meet of two planes in 3-space by first converting them to nor-
two planes. mal vectors and then taking the cross product. This gives
e2 the same answer in this nondegenerate case in 3-space,
e1
using our previous Equation 9, Equation 8, and noting
B that Ĩ3=−I3:

( A ˜I ) × (B ˜I ) = (( A ˜I ) ∧ (B ˜I )) ˜I


3 3 3 3 3

= ((B ˜I ) ∧ ( A  ˜I )) I
may appear to require some optimization process,
3 3 3
the smallest superspace is directly related to the
nonzero part of highest grade in the expansion of the = (B ˜I ) (( A  ˜I ) I )
3 3 3

= (B ˜I ) A = A ∩ B
geometric product and can therefore be done in con-
3
stant time.5
The Meet of two subspaces A and B is their largest
common subspace. Given the Join J ≡ A ∪ B of A and B, So the classical result is a special case of Equation 13,
we can compute their Meet A ∩ B by the property that but Equation 13 is much more general; it applies to the
its dual (with respect to the Join) is the outer product intersection of subspaces of any grade, within a space
of their duals. In formula, this is of any dimension.
The norm of the Meet gives an impression of the
( A ∩ B ) J˜ = (B J˜) ∧ ( A J˜) intersection strength. Between normalized subspaces
in Euclidean space, the magnitude of the Meet is the
or sine of the angle between them. From numerical
analysis, this is a well-known measure for the distance
( A ∩ B)

= B∗ ∧ A∗ (12) between subspaces in terms of their orthogonality—
it is 1 if the spaces are orthogonal and decays grace-
with the dual taken with respect to the Join J. (The fully to 0 as the spaces get more parallel, before
somewhat strange order in Equation 12 means that changing signs. This numerical significance is useful
the Join J can be written using the Meet M in the fac- in applications.
torization J = (AM–1) ∧ M ∧ (M–1B), and it corre-
sponds to Stolfi4 for vectors.) This leads to a formula Differentiation
for the Meet of A and B relative to the chosen Join (use Geometric algebra has an extended operation of dif-
Equation 8): ferentiation, which contains the classical vector cal-
culus and much more. It is possible to differentiate with
(
˜ A
A ∩ B = B J ) (13) respect to a scalar or vector, as before, but now also
with respect to k-blades. This enables efficient encod-
Let us do an example: the intersection of two planes ing of differential geometry, in a coordinate-free man-
1
represented by the 2-blades A=–2 (e1+e2)∧(e2+e3) and ner and gives an alternative look at differential shape

62 July/August 2002
descriptors like the second fundamental form. (It
becomes an immediate indication of how the tangent
plane changes when we slide along the surface.) This
would lead us too far, but we will show two examples
of differentiation. P(x) x 5 The deriva-
Pa(x) tive of the
A rotor’s scalar differentiation spherical
–Iφ/2
Suppose we have a rotor R = e (where Iφ is a func- a projection.
tion of time t) and use it to produce a rotated version X
= RX0R–1 of some constant blade X0. Using the chain
rule and commutation rules, scalar differentiation with
respect to t gives

 
d
X= e(
d −Iφ /2
X oeIφ /2 ) (a ⋅∂ ) xx ≡ lim
x
1  x + λa
λ→0 λ 
 x + λa

x

x 
dt dt
=−
1 d
2 dt
( )(
Iφ e−Iφ /2X oeIφ /2 ) 1

x + λa

x
= lim  − 
( ) ( )
1 d λ→0 λ  −1 x
+ e−Iφ /2X oeIφ /2 Iφ  x 1 + 2λa ⋅ x 
(x + λa)(1 − λa ⋅ x ) − x
2 dt −1
1 d 
=  X
2  dt
Iφ − ( ) d
dt
( )
Iφ X

= lim
λ→0 λx

= X⊗
d
dt
( )
Iφ (15)
=
(
a − x a x −1
) = (a ∧ x )x −1

x x
using the commutator product ⊗ defined in geometric
algebra as the shorthand A ⊗ B ≡ 1/2(AB−BA). This We recognize the result as the rejection of a by x, scaled
product often crops up in computations with continu- appropriately (see the “Projecting subspaces” section
ous groups such as the rotations. from part one1). Figure 5 confirms the outcome. You can
The simple expression that results assumes a more verify in a similar manner that (a ⋅ ∂x)x–1 = –x–1 ax–1
familiar form when X is a vector x in 3-space and when and interpret geometrically.
the attitude of the rotation plane is fixed so that dI/dt =0. For more advanced usage of differentiation relative
We introduce a scalar angular velocity ω ≡ dφ/dt, and to blades, see the Doran et al.2 tutorial, which introduces
the vector dual to the plane as the angular velocity vec- these differentiations using examples from physics, and
tor w, so w ≡ωI Ĩ3=ωI/I3. Therefore, ωI = wI3, which the Lasenby et al.6 application paper.
equals w I3. Using the fact that x ⊗B=1/2(xB−
Bx)=xB for a vector x and a 2-blade B, we obtain Models of geometry
Geometric algebra can help us express several stan-
dard models of geometry. The advantage of doing so is
d
dt
x = x⊗
d
( ) ( )
dt
Iφ = x ⊗ w  I3 an increase in expressive power and a structural inte-
gration of seemingly ad-hoc constructions into the
( ) ( )
= x  w  I3 = x ∧ w  I3 = w × x geometry. Here we look at geometric algebra represen-
tations of homogeneous coordinates and Plücker coor-
dinates as well as a model of Euclidean geometry that
where × is the vector cross product. As before, when we naturally handles spheres.
treated other operations, we find that an equally simple
geometric algebra expression is more general. Here Homogeneous model
Equation 15 describes the differential rotation of k So far we have been treating only homogeneous sub-
dimensional subspaces in n dimensional space, rather spaces of the vector space Vm—that is, subspaces con-
than merely of vectors in 3D. taining the origin. We have spanned them, projected
them, and rotated them, but we have not moved them
Differentiation of spherical projection out of the origin to make more interesting geometrical
Suppose that we project a vector x on the unit sphere structures such as lines floating in space. We construct
by the function x aP(x)=x/|x|. We compute its those now, by extending the ideas behind homogeneous
derivative in the a direction, denoted as (a ⋅ ∂x)P(x) coordinates to geometric algebra. It turns out that such
or Pa(x), as a standard differential quotient and using elements of geometry can also be represented by blades,
Taylor series expansion. Note how geometric algebra in a representational space with an extra dimension.
permits compact expression of the result, with geo- The geometric algebra of this space gives us precisely
metrical significance: what we need. In this view, more complicated geomet-
rical objects do not require new operations or tech-

IEEE Computer Graphics and Applications 63


Feature Tutorial

6 Representing offset subspaces of


Em in (m + 1) dimensional space. (a) p P p^q P
A point P denoted by a vector p with P Q
Q
Euclidean part p. (b) A line element Em p Em p v E
m
e e e
is represented by the bivector p q
formed as the outer product of two p^v
v
points. (c) Reshaping the bivector
shows the correspondence with (a) (b) (c)
Plücker coordinates; here, v ≡ q – p.

niques, merely the standard computations in a higher The former is the direction vector of the directed line;
dimensional space. the latter is an area that we call the moment of the line
The homogeneous model is often described as aug- through p and q. It specifies the distance to the origin, for
menting a 3D vector v with coordinates [v1, v2, v3] to a we can rewrite it to a rectangle spanned by the direction
4-vector [v1, v2, v3, 1]. That extension makes nonlinear (q – p) and the perpendicular support vector d:
operations such as translations implementable as linear
mappings. p ∧ q = p ∧ (q – p) = d(q – p) (17)
We give the (m + 1)-dimensional homogeneous space
into which we embed our m-dimensional Euclidean space where d ≡ (p ∧ (q – p))(q – p)–1 = (p ∧ q)(q – p)–1 is
a full geometric algebra. Let the unit vector for the extra the rejection of p by q – p. We can therefore rewrite the
dimension be denoted by e. This vector must be perpen- same 2-blade p ∧ q in various ways, such as p ∧ q = p ∧
dicular to all regular vectors in the Euclidean space Em, so (q – p) = d(q – p) (with d = e + d), separating the posi-
e  x = 0 for all x ∈ Em. We also need to define e  e to make tional part p or d and the purely Euclidean directional
our algebra complete. This involves some dilemmas that part v ≡ q – p (see Figure 6c). The element p ∧ q con-
are only fully resolvable in the double homogeneous tains all these potential interpretations in one data struc-
model, which we explain later on. For now, we can take ture, which we can construct in all these ways.
e  e = 1. We interpret e as the Euclidean point at the origin. Temporarily reverting to the cross product to make a
Let us now represent the subspaces of interest into connection with a classical representation, we can
this model, simply by using the structure of its geomet- rewrite Equation 16 as
ric algebra.
p ∧ q = e ∧ (q – p) + p ∧ q = (p – q)e + (p × q)I3 (18)
Points. A point at a location p is made by translat-
ing the point at the origin over the Euclidean vector p. We recognize the six Plücker coefficients [p – q; p ×
We do this by adding p to e. This construction gives the q], characterizing the line by its direction vector v =
representation of the point P at location p as the vector q – p and its moment vector m = p × q as
p in (m + 1)-dimensional space:
l = –ve + mI3
p=e+p
The six coefficients [–v1, –v2, –v3, m1, m2, m3] of the line
This is a regular vector in the (m + 1)-space, now inter- in this representation are the coefficients of a 2-blade on
pretable as a Euclidean point. It is of course no more the bivector basis {e1e, e2e, e3e, e2e3, e3e1, e1e2}. This
than the usual homogeneous-coordinates method in dis- integrates the Plücker representation fully into the homo-
guise—p has coordinates [p1, p2, p3, 1] on the ortho- geneous model (for which it was historically designed).
normal basis {e1, e2, e3, e}. We will denote points of the We will see that the compact and efficient Plücker inter-
m-dimensional Euclidean space in script, the vectors section formulas are now straightforward consequences
and blades in the corresponding vector space in bold, of the Meet operation in geometric algebra.
and vectors and blades in the (m + 1)-dimensional
homogeneous space in italic. You can visualize this con- Hyperplanes. If we have an (m – 1)-dimensional
struction as in Figure 6a (necessarily drawn for m = 2). hyperplane characterized as x  n = δ, this can be written
We can multiply these vectors in (m + 1)-dimension- as (e + x)  (n – δe) = 0, so x  (n – δe) = 0. Therefore, n
al space using the products in geometric algebra. Let us – δe is the dual of the blade representing the hyperplane.
consider in particular the outer product and form blades. The dual A* of a blade A in the homogeneous model is
obtained relative to the pseudoscalar e ∧ I3 = eI3 of the
Lines. To represent a line, we compute the 2-blade full space as A* = A (eI3)–1 = A (eI3) = A(eI3), so we get
spanned by the representative vectors of two points:
(n – δe)(eI3) = neI3 – δI3
p ∧ q = (e + p) ∧ (e + q) = e ∧ (q – p) + p ∧ q (16)
This has the usual four Plücker coefficients [n1, n2, n3,
We recognize the vector q – p and the area spanned by –δ], but on the trivector basis {–e2e3e, –e3e1e, –e1e2e,
p and q. Both are elements that we need to describe an e1e2e3}—it is clearly different from the vector basis for
element of the directed line through the points P and Q. points.

64 July/August 2002
Of course, we can also construct the blade represent- ■ Line and plane. The Meet of a line l and a plane π* =
ing the hyperplane directly (rather than dually), given n – δe in general position is computed as
m points on it—namely, as the outer product of the vec-
tors representing those points. l ∩ π = π* l = (n – δe)  (–ve + mI3)
= –(n ⋅ v)e + n  (mI3) – δv + 0
And beyond. These ways of making offset planar = –(n ⋅ v)e + (n ∧ m)I3 – δv
subspaces extend easily. An element of the oriented = –(n ⋅ v)e + (m × n – δv)
plane through the points P, Q, and R is represented by
the 3-blade p ∧ q ∧ r and so on for higher dimensional This is the correct result, representing a point at the
offset subspaces—if the space has enough dimensions to location (δv + n × m)/(n ⋅ v) in its homogeneous
accommodate them. The blades we construct this way (Plücker) coordinates. Note how the orthogonality
can always be rewritten in the form A = dA, where A is relationships between the basis elements automati-
a purely Euclidean blade and d is a vector of the form cally kill the potential term involving δ and m. But the
e + d, with d a Euclidean vector. We should interpret A fact that this term is zero is computed, and that is a
as the direction element, so its grade denotes the dimen- slight inefficiency relative to the direct implementa-
sionality of the flat subspace represented by A. The vec- tion of the same result from a table with Plücker for-
tor d represents the closest point to the origin (so that mulas. It is the computational price we pay for the
d is the perpendicular support vector). membership of the full geometric algebra.

Scalar distances. A small surprise is that even a 0 ■ Two lines. The Meet of two lines in general position is
blade (that is, a scalar) is useful; it is the representation of a measure of their signed distance (remember that in
a scalar distance in the Euclidean space (with a sign but this model a dual is made through a right-multiply by
without a direction), as we will see in the next section. eI3, so the dual of the line –v2e + m2I3 is –v2I3 + m2e):
Such distances are of course regular elements of geome-
try, so it is satisfying to find them on a par with position
vectors, direction vectors, and other elements of higher
( )(
l1 ∩ l2 = l2∗  l1 = −v 2 I 3 + m2 e  −v 1e + m1I 3 )
dimensionality as just another case of a representing blade = m2 ⋅ v 1 + v 2 ⋅ m1
in the homogeneous model of a flat Euclidean space.
retrieving the well-known compact Plücker way of
Caseless subspace interactions determining how lines pass each other in space. Three
Having such a unified representation for the vari- tests on the signs of such quantities representing the
ous geometrical elements implies that computations edges of a triangle determine efficiently whether a
using them are unified as well; they have just become ray hits the triangle. Again, the basis orthogonality
operations on blades in (m + 1)-space, blissfully igno- relationships have made terms containing m1 ⋅ m2 or
rant of what different geometrical situations these v1 ⋅ v2 equal to zero.
computations might represent. This opens the way to
caseless computation in geometrical algorithms. The directional outcomes are accompanied by numer-
The Meet and Join in the homogeneous model func- ical factors (such as n ⋅ v in the first example) relating to
tion just as you would expect, providing the intersec- the computation’s numerical significance. These are an
tion of lines, planes, and so forth. Writing these out in intrinsic part of the object’s computation, not just sec-
their (Plücker) coordinates retrieves the familiar com- ondary aspects we need to think of separately (with the
pact formulas for the coefficients of the result, but danger of being ad hoc) or that we need to compute sep-
they are now accompanied by automatic evaluation arately (costing time).
of the basis on which these coefficients should be
interpreted. That provides immediate identification Double homogeneous model
of the kind of intersection in a manner so well inte- Hestenes7 has recently shown that embedding of
grated that it suggests we might continue our compu- Euclidean space into a representational space of two extra
tation without intermediate interpretation. This leads dimensions and its geometric algebra is powerful and sim-
to caseless geometrical algorithms in which the plifying. This double homogeneous model of Euclidean
dimensionality of intermediate results does not affect space embeds the Euclidean distance properties into the
the data flow. fabric of the algebra used to compute with it.
Even though the actual computation is a caseless
Meet applied to blades, let us see what is going on in ■ The inner product is defined in terms of the Euclidean
1
detail in some typical situations. Following the inter- distance dE between points: p⋅ q=− –2 d 2E (P,Q). That
nal computational combination of the Plücker-like means that the representational space has a rather
coefficients shows how the algebra of the basis ele- special metric because it follows that p ⋅ p = 0 for any
ments takes care of the proper intersection computa- vector p. Only when we assign a special point as the
tion, at a small additional expense compared to the origin can we define vectors denoting the relative posi-
usual implementation using precompiled tables of tion of a point—such a vector p does of course have a
intersection formulas. (We write the contraction of nonzero norm. But we can specify all computations
vectors as the classical inner product to show the cor- without ever introducing such an origin.
respondence clearly.) ■ The outer product constructs spheres—a k-blade rep-

IEEE Computer Graphics and Applications 65


Feature Tutorial

limited, set of grades |l – k|, |l – k| +2, … k + l. Division


Correction requires inversion, but this is closely related to the much
Due to a printing error, the indices in Equation simpler operation of reversion—simply switching the
11 of part one1 are unreadable. The equation signs of certain grades. The structural membership of an
should read element to the larger geometric algebra, with its benefit
of unified relationships between the various operations,
(e ∧ e ) = (e ∧ e ) (e ∧ e ) = (e e ) (e e )
2
i j i j i j i j i j
is then merely paid for by a grade-dependent jump to a
piece of code. When processing data in a batch mode
= ei e j ei e j = − ei ei e j e j = −1 with many similar operations, this would not slow down
things significantly.
Work is underway on an efficient implementation
that capitalizes on these structural properties of geo-
resents a Euclidean (k – 1)-sphere. As a consequence, metric algebra.8 Our first results look promising and are
p ∧ q is the ordered point pair (P, Q) and p ∧ q ∧ r is the getting close to the usual efficiency of the geometrical
circle through P, Q, and R. This provides Plücker coor- computations—but in a simpler code without excep-
dinates for spheres. The dual of the (m + 1)-blade rep- tions or ad-hoc data structures—and naturally inte-
resenting an m-sphere in Em is a vector in the double grating computational techniques that classically belong
homogeneous representation space, which has coef- to different realms than vector/matrix algebra (such as
ficients that immediately provide the sphere’s center quaternions and Plücker coordinates).
and radius. Flat subspaces are represented as spheres
through infinity. This is possible because one of the Conclusion
two extra representational dimensions is a vector rep- This two-part introduction to geometric algebra
resenting the point at infinity. intends to alert you to the existence of a small set of prod-
■ The sandwiching by the geometric product gives rota- ucts that appears to generate all geometric constructions
tions and all conformal mappings, including transla- in one consistent framework. Using this framework can
tion and spherical inversion. This is why the double simplify the set of data structures representing objects
homogeneous model is often called the conformal because it inherently encodes all relationships and sym-
model. metries of the geometrical primitives in those operators.
■ The Meet of two blades is interpretable as intersecting Although there are many interesting facets to geometric
k-spheres in m-space, and its embedding again algebra, we would like to highlight the following:
reduces the separate cases that would need to be dis-
tinguished for such intersections. ■ Division by subspaces. Having a geometric product
with an inverse lets us divide by subspaces, increas-
This model looks appropriate for many computer ing our ability to manipulate algebraic equations
graphics applications, and we are currently developing involving vectors.
it further for practical usage. It is a truly coordinate-free ■ Subspaces are basic elements of computation. Thus, no
model, in which we can specify all operations of Euclid- special representations are needed for subspaces of a
ean geometry without ever referring to an origin. dimension greater than 1 (for example, tangent
planes), and we can manipulate them like we manip-
Implementation ulate vectors.
The geometric algebra of an m-dimensional vector ■ Generalization. Expressions for operations on subspaces
space contains nicely linear objects (the blades) that can are often as simple as those for vectors (that is especially
be represented on a basis that should contain 2m ele- true for linear operations) and as easy to compute.
m
ments (because we need ( k ) for each k blade). The var- ■ Caseless computation. Degenerate cases are comput-
ious products are all linear, and we can implement them ed automatically, results remain interpretable, and
using matrix products of 2m × 2m matrices. That might be the computation lets us test the solution’s numerics.
straightforward, but it is obviously inefficient in both ■ Quaternions. In geometric algebra, quaternions are
space and time. This is even more urgent when we use subsumed and become a natural part of the algebra,
the homogeneous model in which an m-dimensional with no need to convert between representations to
Euclidean space requires an (m + 1)-dimensional geo- perform rotations.
metric algebra, or the (m + 2)-dimensional double ■ Plücker coordinates. Geometric algebra subsumes and
homogeneous model. It seems a lost cause. extends Plücker coordinates and the concise expressions
However, recognizing that the important elements are they give for the interactions of lines, planes, and so on.
blades and their products suggests a more efficient
implementation. When two blades multiply by an inner This article only covers some of what we feel are the
or outer product, a blade of unique grade results. This most important or useful ideas of geometric algebra as it
suggests designing a data representation for the ele- relates to computer graphics. We have left out many top-
ments of geometric algebra that permits easy retrieval ics, including a description of more geometries (the homo-
of their grades and also automatically generating opti- geneous model implements and generalizes the
mized code for the inner and outer multiplication of Grassmann spaces of Goldman9 and the double homoge-
blades of specific grades k and l. Their geometric prod- neous model implements and generalizes projective
uct generates a more general element of a mixed, but still spaces), and we could say a lot more about differentiation

66 July/August 2002
and coordinate-free differential geometry. You should be
able to glean the connections from the “Further Reading” Further Reading
sidebar, although an accessible explanation for computer There is a growing body of literature on
graphics of such issues is still necessary. ■ geometric algebra. Unfortunately, much of the
more readable writing is not very accessible and
Acknowledgments in specialized books rather than general journals.
The Netherlands Organization for Scientific Research Researchers have written little with computer
and the Natural Sciences and Engineering Research science in mind because the initial applications
Council of Canada supported this work in part. have been to physics. We recommend the
following as natural follow-ups to this article:

References ■ Gable, a Matlab package for geometric algebra,


1. L. Dorst and S. Mann, “Geometric Algebra: A Computa- accompanied by a tutorial.1
tional Framework for Geometrical Applications (Part 1),” ■ An application software generator Gaigen.2
IEEE Computer Graphics and Applications, vol. 22, no. 3, ■ The introductory chapters of New Foundations
May/June 2002, pp. 24-31. of Classical Mechanics.3
2. C. Doran and A. Lasenby, Physical Applications of Geomet- ■ An introductory course intended for physicists.4
ric Algebra, 2001, http://www.mrao.cam.ac.uk/~clifford/ ■ An application to a basic but involved geome-
ptIIIcourse/. try problem in computer vision, with a brief
3. D. Hestenes, “The Design of Linear Algebra and Geometry,” introduction into geometric algebra.5
Acta Applicandae Mathematicae, vol. 23, 1991, pp. 65-93. ■ Papers showing how linear algebra becomes
4. J. Stolfi, Oriented Projective Geometry, Academic Press, San enriched by viewing it as a part of geometric
Diego, 1991. algebra.6,7
5. T.A. Bouma, L. Dorst, and H. Pijls, “Geometric Algebra for
Subspace Operations,” to be published in Acta Applicandae Read them in approximately this order. We are
Mathematicae, preprint available http://xxx.lanl.gov/abs/ working on texts more specifically suited for a
math.LA/0104159. computer graphics audience, which may first
6. J. Lasenby et al., “New Geometric Methods for Computer appear as Siggraph courses.
Vision,” Int’l J. Computer Vision, vol. 36, no. 3, 1998, pp.
191-213.
7. D. Hestenes, “Old Wine in New Bottles,” Geometric Alge- References
bra: A Geometric Approach to Computer Vision, Quantum 1. L. Dorst, S. Mann, and T.A. Bouma, GABLE: A Geomet-
and Neural Computing, Robotics, and Engineering, E. Bayro- ric Algebra Learning Environment, http://www.science.
Corrochano and G. Sobczyk, eds., Birkhäuser, Boston, uva.nl/~leo/GABLE/.
2001, pp. 498-520. 2. D. Fontijne, GAIGEN: A Geometric Algebra Implemen-
8. D. Fontijne, GAIGEN: A Geometric Algebra Implementation tation Generator, http://carol.wins.uva.nl/~fontijne/
Generator, http://carol.wins.uva.nl/~fontijne/gaigen/. gaigen/.
9. R. Goldman, “The Ambient Spaces of Computer Graphics 3. D. Hestenes, New Foundations for Classical Mechan-
and Geometric Modeling,” IEEE Computer Graphics and ics, 2nd ed., D. Reidel, Dordrecht, 2000.
Applications, vol. 20, no. 2, Mar./Apr. 2000, pp. 76-84. 4. C. Doran and A. Lasenby, Physical Applications of Geo-
metric Algebra, 2001, http://www.mrao.cam.ac.
uk/~clifford/ptIIIcourse/.
Stephen Mann is an associate pro- 5. J. Lasenby et al., “New Geometric Methods for Com-
fessor in the School of Computer Sci- puter Vision,” Int’l J. Computer Vision, vol. 36, no. 3,
ence at the University of Waterloo. He 1998, pp. 191-213.
has a BA in computer science and 6. C. Doran, A. Lasenby, and S. Gull, “Linear Algebra,”
pure mathematics from the Univer- Clifford (Geometric) Algebras with Applications in
sity of California, Berkeley, and a Physics, Mathematics, and Engineering, W.E. Baylis,
PhD in computer science and engi- ed., Birkhäuser, Boston, 1996.
neering from the University of Washington. His research 7. D. Hestenes, “The Design of Linear Algebra and
interests are in splines and the mathematical foundations Geometry,” Acta Applicandae Mathematicae, vol. 23,
of computer graphics. 1991, pp. 65-93.

Leo Dorst is an assistant professor at


the Informatics Institute at the Uni- Readers may contact Stephen Mann at the School of Com-
versity of Amsterdam. His research puter Science, Univ. of Waterloo, 200 University Ave. W,
interests include geometric algebra Waterloo, Ontario, Canada, email smann@uwaterloo.ca.
and its applications to computer sci-
ence. He has an MSc and PhD in the For further information on this or any other computing
applied physics of computer vision topic, please visit our Digital Library at http://computer.
from Delft University of Technology, The Netherlands. org/publications/dlib.

IEEE Computer Graphics and Applications 67

You might also like