This page is part of multiple pages about robot configuration and usage. Please choose the robot tag to see an overview.
Geometric Algebra (abbreviated GA, similar to: Clifford algebra, exterior algebra) offers descriptions and calculations of geometric with the help of algebra. It was developed in the 19th century, but was almost forgotten. Some key people were:
GA offers
Several geometries are included in GA:
There are several different geometric dimension systems, declared as Gp,q[,r] (or R... or Cl...):
For example,
The choosen dimension has influence on
grade | blade | array index |
0 | 1 (scalar) | 0 |
1 | e1, e2, e3, einf, eo | 1...5 |
2 | e12, e13, e1inf, e1o, e23, e2inf, e2o, e3inf, e3o, einfo | 6...15 |
3 | e123, e12inf, e12o, e13inf, e13o, e1info, e23inf, e23o, e2info, e3info | 16...25 |
4 | e123inf, e123o, e12info, e13info, e23info | 26...30 |
5 | e123info (pseudoscalar) | 31 |
Conformal geometric algebra (CGA) has the following properties:
G4,1 is organized as e1, e2, e3, e+, e- and converted to e1, e2, e3, einf and eo according to this rules:
Every rigid body motion can be represented by a rotation and translation in the direction of the rotation axis, according to Chasles' theorem. This combined motion is called screw. If used for velocity, it is called twist. If used for force/torque, it is called wrench.
Conformal Geometric algebra (CGA) can describe transformations (rotation, reflection, translation, dilation) by so-called rotors with the help of versors. Screw motions can be realised by combining the two rotors rotation and translation. A description can be found in chapter 13.5.2 of the Dorst book. Rotations can be calculated by the cos/sin algorithm easier, but for interpolation (to allow e.g. a smooth rotation with move) by exponentials and logarithms, converting to rotors in geometric algebra is necessary. Quaternion based slerp is such an interpolation, but only for 3D rotations. GA based interpolation allows interpolation of rotations and at the same time translations.
An object can be described by a combination of blades. It can be described by an alternative set of blades called dual. It is calculated by dual = object / I (i. e. A* = AI-1), and has the effect in CGA, that the array elements who describe it have dimension 5-n. Example: if an object uses 2-blades like a circle, the dual circle uses 3-blades. Point pairs use 3-blades, the dual 2-blades. (Dorst names them other round)
I is the pseudoscalar, the e1 ^ e2 ^ e3 ^ einf ^ eo (e123info) blade. / I means multiplying with the inverse of I.
Another example: a plane can be defined by a vector which defines the normal of the plane and the distance to the origin (pl = v + 5 * einf), stored in 1-blades, or as dual plane by using three points together with einf to store it in 4-blades (pl= * (p1 ^ p2 ^ p3 ^ einf)).
In Gaalop and elsewhere, the dual is marked by * in front of the object, e.g. dual = * object;
When an object is dualized two times, the result is negative. To get the correct result, i. e. the original object, there is a special algorithm for "undualization" with the formula (see dissertations Fontijne 2.25 / Colapinto 2.20) A-* = AI
In most cases, the IPNS is called the dual form and the other the standard form.
Every time an object has an einf element (as single einf or as part of a blade), it can be scaled. To normalize it, the einf needs to be 1.0. Gaalop calculates by onor=o/abs(o) to normalize an object. E. g. if o is a vector, abs calculates the length of the vector.
Normalizing is important for angle and distance calculations in most cases.
Storage of objects need between 3 and 10 values of the 32 values of CGA.
There are two methods to create the objects:
IPNS and OPNS methods store the object data in different values of CGA. Both are connected by dualization and can be converted into the other. n-blades of one is 5-n blades of the other. Example: IPNS 2-blades of a line is 3-blades in OPNS mode. The values are stored at different places.
Another classification in literature is between flat (line, plane) and round (circle, sphere) objects.
IPNS means inner product null space, which means, that to check whether a point is part of the object: p∙X=0 (p point, X object, ∙ is the inner product).
object | how calculated | Gaalop sample code | 0...31 array elements |
point | vector + 0.5 * norm² * einf + eo | p=createPoint(1,2,3); | 1-5, 1-blades |
vector | coordinates e1, e2, e3 | v=e1+2 * e2+e3 | 1-3 part of 1-blades |
sphere | point - 0.5 * r * r * einf | s=createPoint(1,2,3)-0.5 * 3 * 3 * einf; | 1-5 1-blades |
plane | normal vector + distance * einf | plane=1 * e1+2 * e2+3 * e3+5 * einf; | 1-4 1-blades without eo |
circle | intersection two spheres | z = s1 ^ s2 | 6-15 2-blades |
line | intersection two planes | l = pl1 ^ pl2 | 6-8, 10, 11, 13 part of 2-blades |
point pair | intersection three spheres | pp = s1 ^ s2 ^ s3 | 16-25 3-blades |
(point) | intersection four spheres | p = s1 ^ s2 ^ s3 ^ s4 |
In IPNS mode, the role of ^ is intersection.
A point is created only with one method.
As example, a circle uses all 2-blades, array elements 6...15, wheres as dual representation (OPNS) it uses all 3-blades, array elements 16...25.
OPNS means outer product null space. A test whether a point is part of the object can be done by p^X=0 (p the point, X the object).
object | how calculated | Gaalop sample code | 0...31 array elements |
sphere | four points of the curvature | s = p1 ^ p2 ^ p3 ^ p4; | 26-30 4-blades |
plane | three points on plane and einf | pl = p1 ^ p2 ^ p3 ^ einf; | 26,28-30 part of 4-blades |
circle | three points on circle | c = p1 ^ p2 ^ p3; | 16-25 3-blades |
line | two points and einf | l = p1 ^ p2 ^ einf; | 17,19,21,22,24,25 part of the 3-blades |
point pair | wedge of two points | pp = p1 ^ p2; | 6-15 2-blades |
(hyperplane) | four points and einf | pl = p1 ^ p2 ^ p3 ^ p4 ^ einf; |
In OPNS mode, the role of ^ is to combine the elements to build the object.
In most cases the dual object is transformed into the normal form. The array elements are those of the normal form then.
A point has only an IPNS representation.
The objects with einf part are also called flat (e. g. plane) and those without einf are called round (e. g. sphere, circle).
Some authors describe additional objects like a hyperplane or different point types.
Calculation of intersections is one of CGA's strengths, because syntax is often very simple, especially if the objects are of the same type like two spheres.
∩ means meet.
There are two methods:
The second method's dual is not necessarly the pseudoscalar. See Fontijne's thesis for detailed information (chapters 2.8.4, 2.13.2).
The second method formulated by Colapinto (see his dissertation chapter 2.2.5 and 2.2.6):
v = (A* ^ B*)-*
where -* is the undualization: A-* = AI
Circle-circle intersection is difficult to calculate, it is easier to convert one of the circles to a sphere and calculate the intersection of circle-sphere.
A very good new article about intersections and distances (see literature link below) is from Bayro-Corrochano et al.
Conformal geometry algebra has its name conformal from the fact that transformations are angle preserving.
"Normal" rotations in linear algebra are done by matrix multiplications, as used in robotics to calculate the effect of angle changes e.g. by L=T2 * T1 .
A second method is possible, using reflections and multiple reflections by sandwitching, e.g. by L=Ro~R, which means an object is pre- and postprocessed with R and ~R. The R operator is called versor or spinor. One reflection is a reflection, but two reflections are a rotation. Versors can be combined. To avoid scaling effects, the versors should be normed.
A reflection by line or plane is possible, but in most cases for transformations bivectors (= 2-blades) are used (e. g. rotate at e1 ^ e2).
Quaternions are rotors in 3D space.
A quaternion q = qw + qi * i + qj * j + qk * k;
qw² + qi² + qj² + qk² = 1
i * j * k = -1
etc.
Then the relation to GA is that the quaternions are the following blades and basis of the rotor bivectors:
i = e3e2
j = e1e3
k = e2e1
There are other relations from other authors, where the sign of the result is different.
To verify code, Gaalop by Hildenbrand/Steinmetz is used. GAViewer by Dorst is also nice and fast, but uses a different syntax. Clifford Multivector Toolbox for Matlab is also available.
An overview of software is in Breuils et al - New Applications ... chapter 10.
Gaalop
Clifford Multivector Toolbox for Matlab (not tested yet)
Recommended books from a personal view are:
There are a lot of free pdf articles and websites available. Additionally, the articles, books and webpages from Dorst, Hildenbrand, Bayro-Corrochano, Vince, Hestenes, Sobczyk, MacDonald, Hitzer, Perwass, Ian Bell, Lasenby (2 persons) and many others are available. Main topics are directed to robotics, geometry, physics, biology and other. The newer books (after 2001) often include CGA.
Poster CGA: http://projectivegeometricalgebra.org/confgeomalg.pdf
a similar one for PGA: http://projectivegeometricalgebra.org/projgeomalg.pdf
(PGA is 4 dimensional, often used for gaming, where Z is recalculated to the plane, i. e. projectioned).
A valuable source are thesis/dissertations, because they often have detailed explanations and they are often freely available. Some dissertations/thesis/master/articles, most use CGA:
About the topic intersection and distances,
About robotics: