Geometric Algebra A powerful tool for solving geometric problems in visual computing
Leandro A. F. Fernandes Manuel M. Oliveira [email protected] [email protected]
CG UFRGS Geometric problems
Geometric data . Lines, planes, circles, spheres, etc.
Transformations . Rotation, translation, scaling, etc.
Other operations . Intersection, basis orthogonalization, etc.
Linear Algebra is the standard framework
2 Using vectors to encode geometric data
Directions Points
3 Using vectors to encode geometric data
Directions Points
Drawback
The semantic difference between a direction vector and a point vector is not encoded in the vector type itself.
R. N. Goldman (1985), Illicit expressions in vector algebra, ACM Trans. Graph., vol. 4, no. 3, pp. 223–243. 4 Assembling geometric data
Straight lines . Point vector . Direction vector
5 Assembling geometric data
Straight lines . Point vector . Direction vector
Planes . Normal vector . Distance from origin
6 Assembling geometric data
Straight lines . Point vector . Direction vector
Planes . Normal vector . Distance from origin
Spheres . Center point . Radius
7 Assembling geometric data
Straight lines . Point vector . Direction vector
Planes . Normal vector . Distance from origin
Spheres Drawback . Center point The factorization of geometric elements . Radius prevents their use as computing primitives.
8 Intersection of two geometric elements
A specialized equation for each pair of elements . Straight line × Straight line . Straight line × Plane . Straight line × Sphere . Plane × Sphere . etc.
Special cases must be handled explicitly . Straight line × Straight line may return • Empty set • Point • Straight line
9 Intersection of two geometric elements
A specialized equation for each pair of elements . Straight line × Straight line . Straight line × Plane . Straight line × Sphere . Plane × Sphere . etc. Linear Algebra Extension Plücker Coordinates Special cases must be handled explicitly
. Straight line × Straight. An linealternative may to returnrepresent flat geometric elements
• Empty set . Points, lines and planes as elementary types
• Point . Allow the development of more general solution
• Straight line . Not fully compatible with transformation matrices
J. Stolfi (1991) Oriented projective geometry. Academic Press Professional, Inc. 10 Using matrices to encode transformations
Projective
Affine
Similitude Linear Rigid / Euclidean Scaling Identity Isotropic Scaling Translation Reflection Rotation Shear
Perspective
11 Drawbacks of transformation matrices
Non-uniform scaling affects point vectors and normal vectors differently
90° > 90°
1.5 X
12 Drawbacks of transformation matrices
Non-uniform scaling affects point vectors and normal vectors differently
Rotation matrices . Not suitable for interpolation . Encode the rotation axis and angle in a costly way
13 Drawbacks of transformation matrices
Non-uniform scaling affects point vectors and normal vectors differently
Rotation matrices
. Not suitable for interpolation Linear Algebra Extension . Encode the rotation axis and angle in a costly way Quaternion
. Represent and interpolate rotations consistently
. Can be combined with isotropic scaling
. Not well connected with other transformations
. Not compatible with Plücker coordinates
. Defined only in 3-D
W. R. Hamilton (1844) On a new species of imaginary quantities connected with the theory of quaternions. In Proc. of the Royal Irish Acad., vol. 2, pp. 424-434. 14 Linear Algebra
Standard language for geometric problems
Well-known limitations
Aggregates different formalisms to obtain complete solutions . Matrices . Plücker coordinates . Quaternion
Jumping back and forth between formalisms requires custom and ad hoc conversions
High-level framework for geometric operations
Geometric elements as primitives for computation
Naturally generalizes and integrates . Plücker coordinates . Quaternion . Complex numbers
Extends the same solution to . Higher dimensions . All kinds of geometric elements
16 Outline
Modules I, II, III and IV . Theoretical concepts
Module V . Models of geometry
Module VI . History . Application in visual computing . Concluding remarks
17 Module I Introduction
18 Vector space
A vector space consists, by definition, of elements called vectors
19 Vector in a vector space
20 Spanning subspaces
Geometric Meaning The subspace spanned The resulting subspace is by vectors a and b a primitive for computation!
21 We need a basis for k-D subspaces
n-D Vector Space 2n-D Multivector Space
consists of 1-D elements can handle k-D elements, called vectors, in the basis for 0 ≤ k ≤ n
It is not enough!
22 Basis for multivector space
Scalars Vector Space Bivector Space Trivector Space
23 Multivectors
Basis for multivector space
Scalars Vector Space Bivector Space Trivector Space
Multivector
24 Properties of the outer product
Antisymmetry
Scalars commute
Distributivity
Associativity
25 Computing with the outer product
Basis for multivector space
Scalars Vector Space Bivector Space Trivector Space
26 Computing with the outer product
Basis for multivector space
Scalars Vector Space Bivector Space Trivector Space
27 Computing with the outer product
Basis for multivector space
Scalars Vector Space Bivector Space Trivector Space
Antisymmetry Scalars commute Distributivity
28 Computing with the outer product
Basis for multivector space
Scalars Vector Space Bivector Space Trivector Space
Antisymmetry Scalars commute Distributivity
29 Computing with the outer product
Basis for multivector space
Scalars Vector Space Bivector Space Trivector Space
30 Module II Metric and Some Inner Products
31 The inner product of vectors
Geometric Meaning Bilinear Form Measures the relation between A scalar-valued function of vectors, vectors a and b like in Linear Algebra
It defines a metric on the vector space b
θ a
32 Properties of the inner product of vectors
Symmetry
Scalars commute
Distributivity
33 The metric matrix
A practical way to implement the bilinear form Q
Defines the inner product of pairs of basis vectors
34 The metric matrix
A practical way to implement the bilinear form Q
Defines the inner productOrthogonal of pairs of3-D basis Euclidean vectors Metric
b
θ a
35 The scalar product
Geometric Meaning Extends the inner product of θ vectors to subspaces having the same dimensionality
** Euclidean Metric 36 Properties of the scalar product
Symmetry
Scalars commute
Distributivity
37 The left contraction
Geometric Meaning
Remove from the part that is like
38 Properties of the left contraction
Symmetry
Scalars commute
Distributivity
39 Resulting Basis Basis orthogonalization
TS isis thethe whole space
40 Checkpoint
Geometric algebra uses a multivector space
Subspaces are primitives for computation
The outer product span subspaces
There are some metric products . The inner product of vectors . The scalar product . The left contraction
41 Module III Geometric Product
42 Geometric product of vectors
Denoted by a whiteInner space, ProductOuter Product like standard multiplication
Unique Feature An invertible product for vectors!
43 Geometric product of vectors
The Inner Product is not Invertible
Unique Feature An invertible product for vectors!
γ
44 Geometric product of vectors
The Outer Product is not Invertible
Unique Feature An invertible product for vectors!
45 Geometric product of vectors
Unique Feature An invertible product for vectors!
Inverse geometric product, denoted by a slash, like standard division
46 Intuitive solutions for simple problems
q
r?
p
t
47 Geometric product and multivector space
The geometric product of two vectors is an element of mixed dimensionality
Scalars Vector Space Bivector Space Trivector Space
48 Geometric product and multivector space
The geometric product of two vectors is an element of mixed dimensionality
Scalars Vector Space Bivector Space Trivector Space
Geometric Meaning The interpretation of the resulting element depends on the operands.
49 Properties of the geometric product
Scalars commute
Distributivity
Associativity
Neither fully symmetric nor fully antisymmetric
50 The most fundamental product of GA
The subspace products can be derived from the geometric product
51 Module IV Orthogonal Transformations as Versors
52 Reflection of vectors
Mirror
Input vector
Vector a was reflected in vector v, resulting in vector a
53 k-Versor
V is a k-versor. It is computed as the geometric product of k invertible vectors.
54 Rotation of subspaces
How to rotate vector a in the plane by radians.
55 Rotation of subspaces
How to rotate vector a in the plane by radians.
56 Rotation of subspaces
Rotors How to rotate vector a in Unit versors encoding rotations. the plane by radians. They are build as the geometric product of an even number of unit invertible vectors.
57 Versor product for general multivectors
Grade Involution The sign change under the grade involution exhibits a + - + - + - … pattern over the value of t.
58 Checkpoint
The geometric product is the most fundamental product of geometric algebra . It is an invertible product . The other linear products can be derived from it
Versors encode linear transformations . Reflections . Rotations (rotors)
Rotors generalize quaternions to n-D spaces
59 Coffee Break
60 Checkpoint
Module I . Subspaces, the outer product, and the multivector space
The resulting subspace is a primitive for computation!
61 Checkpoint
Module I . Subspaces, the outer product, and the multivector space
Scalars Vector Space Bivector Space Trivector Space
62 Checkpoint
Module I . Subspaces, the outer product, and the multivector space
Module II . Metric and some inner products
The inner product of vectors
The scalar product
The left contraction
63 Checkpoint
Module I . Subspaces, the outer product, and the multivector space
Module II . Metric and some inner products
Module III . Geometric product
64 Checkpoint
Module I . Subspaces, the outer product, and the multivector space
Module II . Metric and some inner products
Module III . Geometric product
Module IV . Orthogonal transformations as versors
65 Module V Models of Geometry
66 Geometric Algebra models
Assumes a metric to the space
Gives a geometrical interpretation to subspaces . Directions, points, straight lines, circles, etc.
Makes versors behave like some transformation type . Scaling, rotation, translation, etc.
67 Euclidean vector space model
Euclidean metric matrix
68 Euclidean vector space model
Euclidean metric matrix
Subspaces . k-D directions
Versors . Reflections . Rotations
69 2-D Working Space Homogeneous model
One extra basis vector interpreted as point at origin
Euclidean metric matrix
70 2-D Working Space Homogeneous model
One extra basis vector interpreted as point at origin
Euclidean metric matrix
How Stuff Works
71 2-D Working Space Homogeneous model
One extra basis vector interpreted as point at origin
Euclidean metric matrix
Subspaces . Directions
How Stuff Works
72 2-D Working Space Homogeneous model
One extra basis vector interpreted as point at origin
Euclidean metric matrix
Subspaces . Directions . Flats (point, line, plane)
How Stuff Works
73 2-D Working Space Homogeneous model
One extra basis vector interpreted as point at origin
Euclidean metric matrix
Subspaces . Directions . Flats (point, line, plane)
How Stuff Works
74 Homogeneous model
One extra basis vector interpreted as point at origin
Euclidean metric matrix
Subspaces . Directions . Flats (point, line, plane)
Versors . Rotations around the origin
75 2-D Working Space Conformal model
Two extra basis vectors . Point at origin . Point at infinity
Non-Euclidean metric
76 2-D Working Space Conformal model
Two extra basis vectors . Point at origin . Point at infinity
Non-Euclidean metric
How Stuff Works
77 2-D Working Space Conformal model
Subspaces . Points
How Stuff Works
78 2-D Working Space Conformal model
Subspaces . Points . Rounds (point pair, circle, sphere)
How Stuff Works
79 2-D Working Space Conformal model
Subspaces . Points . Rounds (point pair, circle, sphere) . Flats (flat point, line, plane)
How Stuff Works
80 2-D Working Space Conformal model
Subspaces . Tangent (point, tangent k-D direction) . Rounds (point pair, circle, sphere) . Flats (flat point, line, plane)
How Stuff Works
81 2-D Working Space Conformal model
Subspaces . Tangent (point, tangent k-D direction) . Rounds (point pair, circle, sphere) . Flats (flat point, line, plane) . Free (k-D direction)
How Stuff Works
82 Conformal model
Subspaces . Tangent (point, tangent k-D direction) . Rounds (point pair, circle, sphere) . Flats (flat point, line, plane) . Free (k-D direction)
Versors . Reflections
83 Conformal model
Subspaces . Tangent (point, tangent k-D direction) . Rounds (point pair, circle, sphere) . Flats (flat point, line, plane) . Free (k-D direction)
Versors . Reflections . Rotations
84 Conformal model
Subspaces . Tangent (point, tangent k-D direction) . Rounds (point pair, circle, sphere) . Flats (flat point, line, plane) . Free (k-D direction)
Versors . Reflections . Rotations . Translations
85 Conformal model
Subspaces . Tangent (point, tangent k-D direction) . Rounds (point pair, circle, sphere) . Flats (flat point, line, plane) . Free (k-D direction)
Versors . Reflections . Rotations . Translations . Isotropic scaling
86 Module VI History Application in Visual Computing Concluding Remarks
87 Why I never heard about GA before?
Geometric algebra is a “new” formalism
Paul Dirac (1902-1984)
William R. Hamilton Hermann G. Grassmann William K. Clifford David O. Hestenes (1805-1865) (1809-1877) (1845-1879) (1933-) Wolfgang E. Pauli (1900-1958)
1840s 1877 1878 1980s,1920s 2001
D. Hestenes (2001) Old wine in new bottles..., in Geometric algebra with applications in science and engineering, chapter 1, pp. 3-17, Birkhäuser, Boston. 88 Where geometric algebra has been applied
Perwass (2004) detect corners, line segments, lines, crossings, y-junctions and t-junctions in images
C. B. U. Perwass (2004) Analysis of local image structure using…, Instituts für Informatik und Praktische Mathematik der Universität Kiel, Germany, Tech. Rep. Nr. 0403. 89 Where geometric algebra has been applied
Bayro-Corrochano et al. (1996) analyze the projective structure of n uncalibrated cameras
E. Bayro-Corrochano, et al. (1996) Geometric algebra: a framework for computing point and line correspondences and projective…, in Proc. of the 13th ICPR, pp. 334–338. 90 Where geometric algebra has been applied
Rosenhahn and Sommer (2005) define 2-D/3-D pose estimation of different corresponding entities
B. Rosenhahn, G. Sommer (2005) Pose estimation in conformal geometric algebra part II: real-time pose estimation using…, J. Math. Imaging Vis., 22:1, pp. 49–70. 91 Where geometric algebra has been applied
Hildenbrand et al. (2005) apply the conformal model on the inverse kinematics of a human-arm-like robot
D. Hildenbrand et al. (2005), Advanced geometric approach for graphics and visual guided robot object manipulation, in Proc. of the Int. Conf. Robot. Autom., pp. 4727–4732. 92 Where geometric algebra has been applied
Jourdan et al. (2004) perform automatic tessellation of quadric surfaces
F. Jourdan et al. (2004), Automatic tessellation of quadric surfaces using Grassmann- Cayley algebra, in Proc. Int. Conf. Comput. Vis. Graph., pp. 674–682. 93 Where geometric algebra has been applied
Lasenby et al. (2006) model higher dimensional fractals
J. Lasenby et al. (2006), Higher dimensional fractals in geometric algebra, Cambridge University Engineering Department, Tech. Rep. CUED/F-INFENG/TR.556. 94 Drawbacks
There are some limitations yet . Versors do not encode all projective transformations Projective
Affine
Similitude Linear Rigid / Euclidean Scaling Identity Translation Isotropic Scaling Reflection Rotation Shear
Perspective 95 Drawbacks
There are some limitations yet . Versors do not encode all projective transformations
Efficient implementation of GA is not trivial . Multivectors may be big (2n coefficients) . Storage problems . Numerical instability
Custom hardware is optimized for linear algebra . There is an US patent on the conformal model
A. Rockwood, H. Li, D. Hestenes (2005) System for encoding and manipulating models of objects, U.S. Patent 6,853,964. 96 Concluding remarks
Consistent framework for geometric operations . Geometric elements as primitives for computation . Geometrically meaningful products
Extends the same solution to . Higher dimensions . All kinds of geometric elements
An alternative to conventional geometric approach
It should contribute to improve software development productivity and to reduce program errors
97 How to start
Geometric Algebra for Geometric Algebra with Computer Science Applications in Engineering L. Dorst – D. Fontijne – S. Mann C. Perwass Morgan Kaufmann Publishers (2007) Springer Publishing Company (2009)
98 Questions?
θ
99 Extra
100 Properties of subspaces (or blades)
Attitude The equivalence class , for any
Weight The value of in , where is a reference blade with the same attitude as
Orientation The sign of the weight relative to
Direction The combination of attitude and orientation
101 Dual representation of subspaces
Venn Diagram
The orthogonal complement of is the (n - k)-D subspace included in and disjoint from
102 Dual representation of subspaces
“Taking the dual” operation
“Taking the undual” operation
103 Euclidean vector space model
Solving homogeneous systems of linear equations
104 How to start (other tutorials)
Geometric Algebra: a Computational Framework for Geometrical Applications, Part 1 L. Dorst – S. Mann IEEE Computer Graphics and Applications, 22(3):24-31 (2002)
Geometric Algebra: a Computational Framework for Geometrical Applications, Part 2 S. Mann – L. Dorst IEEE Computer Graphics and Applications, 22(4):58-67 (2002)
Geometric Algebra and Its Application to Computer Graphics D. Hildebrand – D. Fontijne – C. Perwass – L. Dorst Tutorial at Eurographics (2004)
Efficient Implementation of Geometric Algebra D. Fontijne Ph.D. Thesis, University of Amsterdam (2007)
105