GAME23 Sneak Peek
Martin Roelfs, PhD
Lattice Quantum Chromodynamics @ KULAK
GAME23 Sneak Peek
Martin Roelfs
Overview:
An Algebra of Geometry
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
An Algebra for Geometry
Martin Roelfs
The idea of Geometric Algebra in just 30 minutes.
+
+
scalar
vector
bivector
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
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
Martin Roelfs
An Algebra for Geometry
k-reflections
Geometric Gauges
Elements = Transformations = k-Reflections
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
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
This flavor of GA is called PGA.
Martin Roelfs
An Algebra for Geometry
\(ab\) Geometric Product composes reflections
Martin Roelfs
An Algebra for Geometry
\(a\wedge b\) Outer Product Intersects elements
Martin Roelfs
An Algebra for Geometry
\(a\vee b\) Regressive Product joins elements
Martin Roelfs
An Algebra for Geometry
\(a\cdot b\) Dot Product rejects elements
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
\((a\cdot b)b^{-1}\) projects \(a\) onto \(b\).
Martin Roelfs
An Algebra for Geometry
Product of two bireflections
Martin Roelfs
An Algebra for Geometry
Product of two bireflections
Martin Roelfs
An Algebra for Geometry
The sandwich \(XYX^{-1}\) transforms the element \(Y\) with the element \(X\). Intuition:
Martin Roelfs
An Algebra for Geometry
To rotate the red line \(l\) by \(ab\), we first rotate the space by \(ab\), then we combine with \(l\), and then we rotate the space back by \(ba\).
\(ab\) \(l\) \(ba\)
Reflection of the point \(bc\) in the line \(a\): \(a (bc) a\)
Martin Roelfs
An Algebra for Geometry
\(ab\) Geometric Product composes reflections
Martin Roelfs
An Algebra for Geometry
\(ab\) Geometric Product composes reflections
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
An Algebra for Geometry
Martin Roelfs
Key take aways
Implementing the Algebra of 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.
$$ vvXv^{-1}v^{-1} = v^2 X v^{-2} $$
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!
What on earth is the Clifford Algebra \( \mathbb{R}_{p,q,r}\)?
Martin Roelfs
An Algebra for Geometry
The Clifford Algebra \( \mathbb{R}_{p,q,r}\) has \(p\) positive, \(q\) negative, and \(r\) null basis vectors.
Consider the 2D example, \( \mathbb{R}_{2,0,0}\). This has basis vectors \(e_1, e_2\), satisfying \(e_1^2 = e_2^2 = 1\). Any vector is now of the form:
$$ u = a e_1 + b e_2. $$
Martin Roelfs
An Algebra for Geometry
What is the square of \(u\)?
But there is nothing special about \(e_1\) and \(e_2\)! In fact, you might have chosen what I called \(u\) as one of your basis vectors. Therefore we must have
such that \( u^2 = a^2 + b^2 \). So orthogonal vectors anti-commute!
Any line is a linear combination \( u = ae_1 + be_2 \).
Martin Roelfs
An Algebra for Geometry
We have also found a single point: \( e_{12} := e_1 e_2 \).
So we can now form lines through the origin \( e_{12} := e_1 e_2 \) as \(u = a e_1 + b e_2\). What is the square of the point \(e_{12}\)?
Martin Roelfs
An Algebra for Geometry
We recognize the scalar part as the dot product \( u \cdot v = |u||v| \cos\theta \) of the two vectors, whereas the second part is the exterior product \( u \wedge v = |u||v| e_{12} \sin\theta \).
How about the product of two arbitrary lines through the origin?
It behaves like the imaginary unit \(i\)!
The product of two lines yields Euler's formula!
So we can now make all lines through the point \( e_{12}\), but we only have one point. We were promised origin independence! So where are the other points? To find them, we need another line orthogonal to \(e_1\) and \(e_2 \).
Martin Roelfs
An Algebra for Geometry
Martin Roelfs
An Algebra for Geometry
The line at infinity, \(e_0\), is orthogonal to \(e_1\) and \(e_2 \). Besides finding a new line, we also find two new points: \(e_{01}, e_{02}\). Because these lie at infinity, they are called directions.
Recall that lines are specified by the linear equation
$$ ax + by + \delta = 0 $$
We can thus represent arbitrary lines in 2D as
$$ u = ae_1 + be_2 + \delta e_0, $$
where \(\delta\) is the distance from the origin. Similarly, arbitrary directions (points on the horizon)
$$ p_\infty = y e_{01} + x e_{20} $$
whereas arbitrary points are given by
$$ p = e_{12} + p_\infty = e_{12} + y e_{01} + x e_{20} $$
What is the square of \(e_0\)? Well, you cannot reflect in the horizon and live to tell about it!
Martin Roelfs
An Algebra for Geometry
Question: how would we now rotate around a given point \((x, y)\) by an angle \( \theta \)?
Since \(e_0^2 = 0\), all points are created equal:
$$ p^2 = e_{12}^2 = -1$$
Thus all points generate their own local Euler's formula under exponentiation:
$$ R = e^{\theta p} = \cos\theta + p \sin\theta$$
Directions are even easier, because they square to \(p_\infty^2 = 0\):
$$ R = e^{a p_\infty} = 1 + a p_\infty$$
Martin Roelfs
An Algebra for Geometry
So we can straightforwardly rotate around any point \(X_0\) in space by sandwiching any quantity by \(R = e^{\theta p /2}\): \( X(\theta) = R X_0 R^{-1} = e^{\theta p /2} X_0 e^{-\theta p /2} \).
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} $$
Martin Roelfs
An Algebra for Geometry
Martin Roelfs
An Algebra for Geometry
Noteworthy spaces
Describes | Algebra | Group | Name |
---|---|---|---|
2D Plane | E(2) | "Planar quaternions" | |
3D Plane |
E(3) | Dual quaternions | |
Spacetime* | SO(1,3) | Lorentz transformations | |
Spacetime | Poin(3,1) | Poincare transformations |
Question: what is the difference between \(\mathbb{R}_{1,3,0}\) and \(\mathbb{R}_{1,3,1}\)?
Closing remarks
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 a point. But in 3D, the dual of a plane, is also a point.
scalar
vector
bivector
Martin Roelfs
An Algebra for Geometry
Duality
scalar
vector
bivector
Martin Roelfs
An Algebra for Geometry
Forces + Torque = Forque
In the body frame :
push at origin = translation
push at infinity = rotation
Force and Torque are both lines.
in any # dimensions.
scalar
vector
bivector
Martin Roelfs
An Algebra for Geometry
Forces + Torque = Forque
The forque line is the dual of the "axis" of the transformation.
scalar
vector
bivector
Martin Roelfs
An Algebra for Geometry
Thank you!
For more information, libs, tools and docs ...
https://bivector.net
Martin Roelfs
An Algebra for Geometry
On to the ganja.js Coffeeshop!
Visit to the ganja.js Coffeeshop!
Beyond Cartan-Dieudonné: The Discovery of Invariant Geometry
What happens to points in the plane when we perform an increasing number of reflections?
Martin Roelfs
The Discovery of Invariant Geometry
What happens to points in 3D space when we perform an increasing number of reflections?
Martin Roelfs
The Discovery of Invariant Geometry
Clearly we found a new line, but which one is it? To answer this question we must use gauges.
Martin Roelfs
The Discovery of Invariant Geometry
The Geometry of Physics
One mans linear momentum is another mans angular momentum
Martin Roelfs
The Geometry of Physics
One mans linear momentum is another mans angular momentum
Martin Roelfs
The Geometry of Physics
One mans linear momentum is another mans angular momentum
Martin Roelfs
The Geometry of Physics
Wigner rotation
Martin Roelfs
The Geometry of Physics
Alice has velocity \( u_A \), while Bob has velocity \( u_B \). In order for Alice to see the world from Bob's perspective, she could simply reflect over the bisector
$$ \overline{u_A + u_B} = \frac{u_A + u_B}{\sqrt{2 + 2 u_A \cdot u_B}} $$
However, this would leave her PT inverted, which may or may not be fatal, so it's best to first perform an extra reflection in place just to be sure:
$$ \Lambda = (\overline{u_A + u_B}) u_A^{-1} $$
This is the boost to transform from Alice to Bob:
$$ \Lambda u_A \widetilde{\Lambda} = u_B$$
Part 1: Theory and motivation
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
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?
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
Martin Roelfs
An Algebra for Geometry