19
Geometric Algebra Geometric Algebra Part 2: Applications and the state of the art Part 2: Applications and the state of the art Vitor Fernando Pamplona   ... provides a single, simple mathematical framework which ... provides a single, simple mathematical framework which eliminates the plethora of diverse mathematical descriptions and eliminates the plethora of diverse mathematical descriptions and techniques” techniques” [McRobie and Lasenby, 1999] [McRobie and Lasenby, 1999]

Geometric Algebra 2: Applications

Embed Size (px)

DESCRIPTION

UFRGS seminar in Geometric Algebra

Citation preview

Page 1: Geometric Algebra 2: Applications

Geometric AlgebraGeometric AlgebraPart 2: Applications and the state of the artPart 2: Applications and the state of the art

Vitor Fernando Pamplona

  ““... provides a single, simple mathematical framework which ... provides a single, simple mathematical framework which 

eliminates the plethora of diverse mathematical descriptions and eliminates the plethora of diverse mathematical descriptions and 

techniques”techniques”[McRobie and Lasenby, 1999][McRobie and Lasenby, 1999]

Page 2: Geometric Algebra 2: Applications

Review: Geometric ProductReview: Geometric Product

• Outer product spansOuter product spans

• Inner product projectsInner product projects

• Geometric ProductGeometric Product

e1

e2

O

2D

e1∧e2

1 e1 ∧ 2 e2 = 1 2 e1 e2

12 e1 ∧ e2 ⋅ e2 = 12 e1

vu= v⋅u v ∧ u

Inner productInner product Outer productOuter product

Page 3: Geometric Algebra 2: Applications

Review: MultivectorReview: Multivector

• Unique n­dimensional structureUnique n­dimensional structure

vℜ 3=

e1 e2 e3 e1 e2 e1 e3 e2 e3

e1 e2 e3

ScalarScalar

VectorVector

2­Blade2­Blade

3­Blade3­Blade

mv3 = 3 e1 ∧ e3 − 2 e2 ∧ e3

Page 4: Geometric Algebra 2: Applications

OverviewOverview

• HomogeneousHomogeneous Model Model

• ConformalConformal Model Model

• Meet / JoinMeet / Join

• Framework Framework GaigenGaigen

• nD­VoronoinD­Voronoi Diagram Diagram

• CliffoSorCliffoSor: GA processor: GA processor

• Physical ModellingPhysical Modelling using GA using GA

• FutureFuture Readings Readings

Page 5: Geometric Algebra 2: Applications

P

QR²

P

Homogeneous ModelHomogeneous Model

• Generalization to Generalization to homogeneous coordinateshomogeneous coordinates of VA of VA

• Affine and projective Affine and projective transformationstransformations

• Adds one dimensionAdds one dimension to working space to working space

• There are There are no changesno changes in basic operations in basic operations

pp

e0

pq

e0

pΛq

Page 6: Geometric Algebra 2: Applications

Conformal ModelConformal Model

• Adds Adds 2 new orthogonal2 new orthogonal dimensions dimensions

• It is a It is a Minkowski Minkowski space.space.

• ChangesChanges some operations some operations

• Euclidean to ConformalEuclidean to Conformal GA Model GA Modela=0,∞ ,x ,y ,z=1,1 /2a2 ,ax ,ay ,az

e0 e∞

C=p1∧p2∧p3E=p1∧p2∧p3∧p4N=p1∧p2∧p3∧e∞

e∞

2=1 e0

2=−1 e∞⋅e0=0

Page 7: Geometric Algebra 2: Applications

Meet and JoinMeet and Join

Page 8: Geometric Algebra 2: Applications

Framework GaigenFramework Gaigen

• Geometric Algebra C/C++ Geometric Algebra C/C++ Code GeneratorCode Generator

• Version 1.0 released Version 1.0 released 1,51,5 years ago.  years ago. 

• Generates the same code of Generates the same code of GAPGAP framework.  framework. 

• 8­Dimensional Limit.8­Dimensional Limit.

• Free Software :: Free Software :: http://gaigen.sourceforge.nethttp://gaigen.sourceforge.net

• From Daniel Fontijne at University of AmsterdanFrom Daniel Fontijne at University of Amsterdan

• Version 2.0 will generate Version 2.0 will generate JavaJava code too.  code too. 

Page 9: Geometric Algebra 2: Applications

Why an nD­Voronoi Diagram?Why an nD­Voronoi Diagram?

Model Implem. Full Rend Time (s) Memory (MB)3DLA Standard 1.00 6.23DGA Gaigen 2.56 6.74DLA Standard 1.05 6.44DGA Gaigen 2.97 7.75DGA Gaigen 5.71 9.9

• Raytracer Raytracer benchmarkbenchmark

• 3DLA: Linear Algebra3DLA: Linear Algebra

• 3DGA: Geometric Algebra3DGA: Geometric Algebra

• 4DLA: Homogeneous coordinates4DLA: Homogeneous coordinates

• 4DGA: Homogeneous model4DGA: Homogeneous model

• 5DGA: Conformal model5DGA: Conformal model

[Fontijne, D. & Dorst,2003][Fontijne, D. & Dorst,2003]

Page 10: Geometric Algebra 2: Applications

Edelsbrunner's idea Edelsbrunner's idea 

x n=∑i=0

n−1

x i2

• AlgorithmAlgorithm

http://www.ics.uci.edu/~eppstein/junkyard/nn.html

VoronoiDiagram edelsbrunner(Points S)

1. Create a new orthogonal dimension 

2. Build the paraboloid R

3. For each point P

4. P' = projection of P on the paraboloid R

5. H  = the hyperplane tangent to paraboloid R in P'

6. End for

7. Project the upper­envelope of H's on initial dimension.

O

Page 11: Geometric Algebra 2: Applications

Edelsbrunner with Geometric AlgebraEdelsbrunner with Geometric Algebra1. 1. D+2D+2 Geometric Algebra Solution Geometric Algebra Solution

• Edelsbrunner Edelsbrunner paraboloid   paraboloid   • HomogeneousHomogeneous model model

2. Step 2 is not needed2. Step 2 is not needed

4. 4. Project pProject p on R on R

5. Find 5. Find hyperplane tangenthyperplane tangent  

e0

e∞

... edelsbrunner(Points S)

1. New dimension 

2. Build paraboloid R

3. For each point p

4. p'= proj. of p on R

5. H= tangent to R in p'

6. End for

7. Proj. the upper­envelope  

H T= p '∧d u a l p∧p2 p2 e

∣p∣∗ 1 4 p2

p '=p p2 e∞

Page 12: Geometric Algebra 2: Applications

Edelsbrunner with Geometric AlgebraEdelsbrunner with Geometric Algebra7. 7. Project the upper­envelopeProject the upper­envelope of  of 

hyperplanes on the d­2 hyperplanes on the d­2 dimension.dimension.

backTracking(hypercube F) 

1. if (lowestGrade(F) == 2)

2. F=meet(F,each out of stack HP)

3. add lowestGrade(F) to Voronoi.

4. else 

5. for each out of stack HP

6. F=meet(F, HP)

7. BackTracking(F)

8. F = removeLowestGrade(F)

backTracking(hypercube bounding box)

... edelsbrunner(Points S)

1. New dimension 

2. Build paraboloid R

3. For each point p

4. p'= proj. of p on R

5. H= tangent to R in p'

6. End for

7. Proj. the upper­envelope  

FlagFlag: Hierarchy of half­: Hierarchy of half­spaces with the lowest spaces with the lowest level is a pair of points. level is a pair of points. 

Page 13: Geometric Algebra 2: Applications

The Benchmark The Benchmark 

42  points in 2D 16 points in 2DQhull 0.004 + /­ 0.001 0.003 + /­ 0.000Zaharia 32.127 + /­ 0.546 1.512 + /­ 0.005Pam plona 0.592 + /­ 0.006 0.080 + /­ 0.004

● Time in Time in secondsseconds● Each test was performed Each test was performed 5 times5 times● Test Architecture:Test Architecture:

● Processor: Athlon Processor: Athlon 6464, 2800+, 1800Mhz, , 2800+, 1800Mhz, 97% Free97% Free● Memory: 1 GB RAM / Memory: 1 GB RAM / 600 MB600 MB Free Free● OS: Gentoo Linux, install from OS: Gentoo Linux, install from Stage 1Stage 1..● Qhull version: Qhull version: 3.1­r13.1­r1● Zaharia Zaharia GAPGAP version version

Page 14: Geometric Algebra 2: Applications

Problems Problems ● PrecisionPrecision problems problems

● Work with high precision numbers: Work with high precision numbers: 1010­16­16 ... 10  ... 10 88

● Easy to get Easy to get Double.NANDouble.NAN

● Easy to get Easy to get unreportedunreported edges edges

● InfinityInfinity edges, no bounding box edges, no bounding box

● Work with Work with higher dimensionshigher dimensions??

● Need backtracking algorithm? Need backtracking algorithm? ● Search Hyperplane Search Hyperplane neighborsneighbors? ? ● Kd­treesKd­trees, Quadtrees, Octrees , Quadtrees, Octrees 

Page 15: Geometric Algebra 2: Applications

CliffoSorCliffoSor

• ParallelParallel Embedded Architecture for GA. Embedded Architecture for GA.

• Multiplications, additions in Multiplications, additions in 4D4D and 3D rotations. and 3D rotations.

• Operations in Operations in ParallelParallel

• Gaigen 1.0 vs CliffoSorGaigen 1.0 vs CliffoSor

– Gaigen: Gaigen: 256 256 clock cyclesclock cycles

– CliffoSor: CliffoSor: 6464 clock cycles clock cycles

– Test made with Test made with 500.000500.000 geometric products. geometric products.

Page 16: Geometric Algebra 2: Applications

Physical Modelling using GAPhysical Modelling using GA• ParticleParticle Dynamics without GA Dynamics without GA

• Rigid BodyRigid Body Dynamics with GA Dynamics with GA

• Collision DetectionCollision Detection with GA with GA

– BoundingBounding Spheres Spheres

– SegmentSegment Triangle  Triangle IntersectionIntersection

• Collision ResponseCollision Response with GA with GA

• ConclusionsConclusions

– Mathematics Mathematics simplificationsimplification in the collision detection  in the collision detection 

– Needs Needs experienceexperience with GA with GA

Page 17: Geometric Algebra 2: Applications

Physical Modelling: Future WorksPhysical Modelling: Future Works• Hardware Hardware parallelismparallelism

– outer, inner and geometric productsouter, inner and geometric products

• Advanced Collision Detection:Advanced Collision Detection:

– Oct­treesOct­trees

– Sphere­treesSphere­trees

Page 18: Geometric Algebra 2: Applications

Future WorksFuture Works• CGA in CGA in Computer VisionComputer Vision

• Clifford Clifford FourierFourier Transform Transform

• DerivativesDerivatives and  and IntegralsIntegrals

• Generalization of Generalization of QuaternionsQuaternions

• Inverse Inverse KinematicsKinematics with dual of Quaternions with dual of Quaternions

• InterpolationInterpolation with CGA with CGA

• Mesh Mesh deformationdeformation

Page 19: Geometric Algebra 2: Applications

ReferencesReferences• Dorst, L. & Mann, S. Geometric algebra: a computational framework for geometrical Dorst, L. & Mann, S. Geometric algebra: a computational framework for geometrical 

applications (part II: aplications) IEEE Computer Graphics and Applications, 2002, 1applications (part II: aplications) IEEE Computer Graphics and Applications, 2002, 1

• Dorst, L. & Mann, S. Geometric algebra: a computational framework for geometrical Dorst, L. & Mann, S. Geometric algebra: a computational framework for geometrical 

applications (part I: algebra) IEEE Computer Graphics and Applications, 2002, 1, 24­31applications (part I: algebra) IEEE Computer Graphics and Applications, 2002, 1, 24­31

• Fontijne, D. & Dorst, L. Modeling 3D Euclidean Geometry IEEE Computer Graphics and Fontijne, D. & Dorst, L. Modeling 3D Euclidean Geometry IEEE Computer Graphics and 

Applications, 2003Applications, 2003

• Macdonald, A. A Survey of Geometric Algebra and Geometric Calculus, 2005Macdonald, A. A Survey of Geometric Algebra and Geometric Calculus, 2005

• Vaz, J.J. A álgebra geométrica do espaço euclidiano e a teoria de Pauli Revista Vaz, J.J. A álgebra geométrica do espaço euclidiano e a teoria de Pauli Revista 

Brasileira de Ensino de Física, 1997, 19, 234­259Brasileira de Ensino de Física, 1997, 19, 234­259

• Zaharia, M.D. & Dorst, L. The Interface Spec. and Implementation Internals of a Zaharia, M.D. & Dorst, L. The Interface Spec. and Implementation Internals of a 

Program Module for Geometric Algebra University of Amsterdam, 2003Program Module for Geometric Algebra University of Amsterdam, 2003