Steven De Keninck PRO
Mathematical Experimentalist
An Algebra for Geometry:
Projective Geometric Algebra
Martin Roelfs
An Algebra for Geometry
Martin Roelfs
Part one: theory and motivation
Part two: hands-on
Part 1: Theory and motivation
An Algebra for Geometry
Martin Roelfs
// construct lines
line_from_points (p1, p2)
line_from_points_and_dir (p, d)
line_from_plucker (a, b, c, d, e, f)
// construct planes
plane_from_points (p1, p2, p3)
plane_from_point_and_dirs (p, d1, d2)
plane_from_points_and_dir (p1, p2, d)
plane_from_point_and_line (p, l)
plane_from_equation (a, b, c, d)
// Intersections
intersect_line_plane (l, P)
intersect_plane_plane (P1, P2)
intersect_planes (P1, P2, P3)
// Projections
project_point_plane (p, P)
project_line_plane (l, P)
project_point_line (p, l)
// construct transformations
mtx_translate (x, y, z)
mtx_rotate_euler (h, p, b)
mtx_rotate_axis_angle (x, y, z, a)
mtx_look_at (from, too, pole)
// apply transformations
transform_point (M, p)
transform_direction (M, d)
transform_line (M, l)
transform_plane (M, P)
Current state of affairs: linear algebra representation of geometry.
An Algebra for Geometry
Martin Roelfs
Wouldn't it be better if we had a single bag of numbers, where each element in this bag is an element of geometry?
Transform \(a\) by \(b\):
Project \(a\) onto \(b\):
(Projective) Geometric Algebra
Teaser: let \(a\) and \(b\) be any elements of geometry (points, lines, planes, translation, rotations, etc)
- Mathematical operations such as multiplication and addition are always geometrically meaningful
- Not tied to a particular number of dimensions
Introduction to Geometric Algebra in just 15 mins.
+
+
scalar
vector
bivector
Martin Roelfs
An Algebra for Geometry
The atoms of Geometry turn out to be reflections
k-reflections
Geometric Gauges
Elements = Transformations = k-Reflections
Martin Roelfs
An Algebra for Geometry
This flavor of GA is called PGA.
Martin Roelfs
An Algebra for Geometry
k-reflections
Geometric Gauges
Each k-reflection (with k>1) can be gauged without changing the result.
Martin Roelfs
An Algebra for Geometry
Gauges tell us how reflections combine!
Cartan-Dieudonné
Every orthogonal transformation in an n-dimensional embedding space
is composed from at most n reflections
Martin Roelfs
An Algebra for Geometry
\(ab\) Geometric Product composes reflections
\(a\wedge b\) Outer Product Intersects elements
\(a\vee b\) Regressive Product joins elements
\(a\cdot b\) Dot Product rejects elements
Martin Roelfs
An Algebra for Geometry
All well and good, but how do I actually compute something?
Key observation: performing the same reflection twice is the same as doing nothing. I.e., \( v^2 = \pm 1 \)
Martin Roelfs
An Algebra for Geometry
Therefore our Algebra of Geometry can be represented using normalized vectors in a Clifford Algebra!
Martin Roelfs
An Algebra for Geometry
Thank you!
For more information, libs, tools and docs ...
https://bivector.net
Martin Roelfs
An Algebra for Geometry
Part 2: Refresher and Hands on
Hands-on session on Geometric algebra
+
+
scalar
vector
bivector
Martin Roelfs
An Algebra for Geometry
Answer to some questions
+
+
scalar
vector
bivector
Martin Roelfs
An Algebra for Geometry
// construct lines
line_from_points (p1, p2)
line_from_points_and_dir (p, d)
line_from_plucker (a, b, c, d, e, f)
// construct planes
plane_from_points (p1, p2, p3)
plane_from_point_and_dirs (p, d1, d2)
plane_from_points_and_dir (p1, p2, d)
plane_from_point_and_line (p, l)
plane_from_equation (a, b, c, d)
// Intersections
intersect_line_plane (l, P)
intersect_plane_plane (P1, P2)
intersect_planes (P1, P2, P3)
// Projections
project_point_plane (p, P)
project_line_plane (l, P)
project_point_line (p, l)
// construct transformations
mtx_translate (x, y, z)
mtx_rotate_euler (h, p, b)
mtx_rotate_axis_angle (x, y, z, a)
mtx_look_at (from, too, pole)
// apply transformations
transform_point (M, p)
transform_direction (M, d)
transform_line (M, l)
transform_plane (M, P)
Answer: if you call a couple of such functions in a sequence, there is no way to see if this can be simplified. If all of these operations are algebraic expressions on the other hand, you can simplify them.
scalar
vector
bivector
Martin Roelfs
An Algebra for Geometry
In 2D we reflect in a line, in 3D in a plane, in nD in a hyperplane. In (pseudo-)Euclidean space \( E(p,q) \), hyperplanes satisfy the linear equation
$$ ax + by + cz + ... + \delta = 0 $$
Therefore, hyperplanes can be represented by vectors in \(\mathbb{R}_{p,q,1}\), with basis vectors \( \mathbf e_0^2= 0 \) and
\[ \mathbf e_1^2= \ldots = \mathbf e_p^2 = -\mathbf e_{p+1}^2= \ldots = -\mathbf e_{p+q}^2 = 1, \]
as
$$ v = a \mathbf e_1 + b\mathbf e_2 + c\mathbf e_3 + ... + \delta \mathbf e_0 $$
To reflect a hyperplane \(w\) in a hyperplane \(v\), use conjugation:
$$ w \to v[w] = - v w v^{-1} $$
Reflections are involutory, and thus demanding
$$ v[v[w]] = w $$
leads to \( v^2 = v^{-2} = \pm 1 \).
Importantly, \( v[v] = -v \).
scalar
vector
bivector
Martin Roelfs
An Algebra for Geometry
In \(d\) dimensions, we start from reflections in \( d-1 \) dimensional hyperplanes. \(k\) of these can then be intersected to form \( d - k \) dimensional elements of geometry.
scalar
vector
bivector
Martin Roelfs
An Algebra for Geometry
The composition of two reflections leads to a handedness preserving isometry.
We call such transformations
Bireflections
Bireflections \( R = uv \) preserve handedness, and are continuous transformations.
Why two-sided transformations? If I ask you to write upside down, what is the easiest way to do it?
scalar
vector
bivector
Martin Roelfs
An Algebra for Geometry
Duality
Vectors are always \(d-1\) dimensional subspaces (hyperplanes). What if we want to make a true point, which remains a point if we change the dimension?
The dual of a \(d-k\) dimensional quantity is always a \(k\) dimensional quantity. E.g. in 2D, the dual of a line is always a point.
Comparison to matrices
+
+
scalar
vector
bivector
Martin Roelfs
An Algebra for Geometry
In order to transform a point by a rotation and a translation in linear algebra, e.g. open3d.geometry.PointCloud.transform
, we use the covariant transformation
where \( \vec{p}_\infty \) is a 3-vector indicating a point on the horizon, \(p_o \) is the origin, \(R\) is a 3x3 rotation matrix, and \(t\) is a 3-vector encoding the translation.
This 4x4 matrix uses 16 floats, and can only transform points. For planes we have to use the 4x4 contravariant rep., and for lines the 6x6 adjoint rep. By contrast, the PGA equivalent rotor
$$ R = a + b\mathbf{e}_{23} + c\mathbf{e}_{31} + d\mathbf{e}_{12} + e\mathbf{e}_{01} + f\mathbf{e}_{02} + g\mathbf{e}_{03} + h\mathbf{e}_{0123} $$
transforms points, lines and planes identically using only 8 floats.
+
+
scalar
vector
bivector
Martin Roelfs
An Algebra for Geometry
4x4 matrix multiplication : 64 multiplications, 48 additions, 16 floats
PGA motor multiplication : 48 multiplications, 40 additions, 8 floats
with a similar picture for the other elements :
scalar
vector
bivector
Martin Roelfs
An Algebra for Geometry
As
The idea of Geometric Algebra in just 30 mins.
A simple example ..
\(d_i = \big ( \frac 1 f - \frac 1 {d_0} \big )^{-1}\qquad h_i=-\frac {d_i} {d_0} h_0\)
Martin Roelfs
An Algebra for Geometry
The idea of Geometric Algebra in just 30 mins.
\(d_i = \big ( \frac 1 f - \frac 1 {d_0} \big )^{-1}\qquad h_i=-\frac {d_i} {d_0} h_0\)
The paraxial approximation of the thin lens equation
Martin Roelfs
An Algebra for Geometry
\(d_i = \big ( \frac 1 f - \frac 1 {d_0} \big )^{-1}\qquad h_i=-\frac {d_i} {d_0} h_0\)
The paraxial approximation of the thin lens equation
\(\vec a = \overline {\vec c - \vec f}\)
\(\vec b= \vec c - \vec p\)
\(d_0 = \vec a \cdot \vec b\)
Martin Roelfs
An Algebra for Geometry
\(d_i = \big ( \frac 1 f - \frac 1 {d_0} \big )^{-1}\qquad h_i=-\frac {d_i} {d_0} h_0\)
The paraxial approximation of the thin lens equation
\((\overline {\vec c - \vec f}) \, \cdot\)
\((\vec c - \vec p)\)
\(d_0 = \)
\(h_0 = (\overline{\vec c - \vec g} )\,\cdot\,(\vec c - \vec p) \)
Martin Roelfs
An Algebra for Geometry
Formula can be read left to right, no information is hidden, no scalar ratios or coefficient calculations needed.
Martin Roelfs
An Algebra for Geometry
\(\vee\) = join \(\wedge\) = meet \(\bullet\) = dot
Martin Roelfs
An Algebra for Geometry
Martin Roelfs
An Algebra for Geometry
Martin Roelfs
An Algebra for Geometry
\(d_i = \big ( \frac 1 f - \frac 1 {d_0} \big )^{-1}\qquad h_i=-\frac {d_i} {d_0} h_0\)
\(h_0 = (\overline{\vec c - \vec g} )\,\cdot\,(\vec c - \vec p) \)
\(d_0 = (\overline{\vec c - \vec f} )\,\cdot\,(\vec c - \vec p) \)
\(i = -d_i\overline{(\vec c - \vec f )} - h_i \overline{(\vec c - \vec g)} + \vec c \)
no need for :
Martin Roelfs
An Algebra for Geometry
Martin Roelfs
An Algebra for Geometry
Thank you!
For more information, libs, tools and docs ...
https://bivector.net
Martin Roelfs
An Algebra for Geometry
An Algebra for Geometry
Martin Roelfs
The idea of Geometric Algebra in just 30 minutes.
+
+
scalar
vector
bivector
The Geometry of Arrows and its Algebra.
Given the green arrows, all operations are well defined.
Martin Roelfs
An Algebra for Geometry
The Geometry of Arrows and its Algebra.
Given the green arrows, all operations are well defined.
Given the green points, no operation makes geometric sense.
Euclid's first postulate : two points determine a single line.
(and nothing else!)
Martin Roelfs
An Algebra for Geometry
The Geometry of Arrows and its Algebra.
For any operation \(\circ\) between two points to be geometric, its result must be in the 1D line they span!
(that's addition, subtraction, all products ...)
Martin Roelfs
An Algebra for Geometry
The Geometry of Arrows and its Algebra.
Lines and Planes are even more problematic, and can not trivially be mapped to arrows or multi-arrows.
Martin Roelfs
An Algebra for Geometry
The Geometry of Arrows and its Algebra.
How can we improve this?
Martin Roelfs
An Algebra for Geometry
Homogeneous/Projective Coordinates
Martin Roelfs
An Algebra for Geometry
For the geometry of points, lines, planes ..
Instead of an algebra of arrows,
we use an algebra build from reflections.
k-reflections
Geometric Gauges
Martin Roelfs
An Algebra for Geometry
k-reflections
Geometric Gauges
Each k-reflection (with k>1) can be gauged without changing the result.
Martin Roelfs
An Algebra for Geometry
By Steven De Keninck
Martin Roelfs - An Algebra of Geometry