Projective : A Swiss army knife for doing Cayley-Klein

Charles Gunn Sept. 18, 2019 at ICERM, Providence

Full-featured slides available at: https://slides.com/skydog23/icerm2019.

Check for updates incorporating new ideas inspired by giving the talk.

This first slide will indicate whether update has occurred.

1 . 1 What is Cayley-Klein geometry?

Example: Given a conic section Q in RP 2. For two points x and y "inside" Q, define

d(a, b) = log(CR(f+, f−; x, y))

where f+, f− are the intersections of the xy with Q and CR is the cross ratio. CR is invariant under projectivities ⇒ d is a distance function and the white region is a model for hyperbolic plane H2.

1 . 2 What is Cayley-Klein geometry?

SIGNATURE of Quadratic Form Example: (+ + −0) = (2, 1, 1)

e0 ⋅ e0 = e1 ⋅ e1 = +1, e2 ⋅ e2 = −1, e3 ⋅ e3 = 0, ei ⋅ ej = 0 for i = j

1 . 3 What is Cayley-Klein geometry?

Signature of Q κ Space Symbol (n + 1, 0, 0) +1 elliptic Elln, Sn (n, 1, 0) -1 hyperbolic Hn "(n, 0, 1)" 0 euclidean En

1 . 4 3D Examples

The Sudanese Moebius band in S3 discovered by Sue Goodman and Dan Asimov, visualized in UNC-CH Graphics Lab, 1979.

1 . 5 3D Examples

Tessellation of H3 with regular right-angled dodecahedra (from "Not Knot", Geometry Center, 1993).

1 . 6 3D Examples

The 120-cell, a tessellation of the 3- S3 (PORTAL VR, TU-Berlin, 18.09.09)

1 . 7 Cayley-Klein for n = 2

Name elliptic euclidean hyperbolic signature (3,0,0) "(2,0,1)" (2,1,0) null points x2 + y2 + z2=0 x2 + y2 − z2=0

1 . 8 Cayley-Klein geometries for n = 2

Name elliptic euclidean hyperbolic signature (3,0,0) "(2,0,1)" (2,1,0) null points x2 + y2 + z2=0 z2=0 x2 + y2 − z2=0

1 . 8 Example Cayley-Klein geometries for n = 2

Name elliptic euclidean hyperbolic signature (3,0,0) "(2,0,1)" (2,1,0) null points x2 + y2 + z2=0 z2=0 x2 + y2 − z2=0 null lines* a2 + b2 + c2=0 a2 + b2=0 a2 + b2 − c2=0

*The line ax + by + cz = 0 has line coordinates (a, b, c).

1 . 9 Question

What is the best way to do Cayley-Klein geometry on the computer?

2 . 1 Question

What is the best way to do Cayley-Klein geometry on the computer?

1993

2 . 1 Question

What is the best way to do Cayley-Klein geometry on the computer?

1993 2019

2 . 1 Vector + linear algebra

2 . 2 Vector + linear algebra

Projective points

Projective matrices

2 . 2 Vector + linear algebra

Projective points

Projective matrices

2 . 3 Vector + linear algebra

Projective points

Projective matrices

But it's 2019 now. Can we do better?

2 . 3 Cayley-Klein programmer's wish list

2 . 4 Cayley-Klein programmer's wish list

Coordinate-free

2 . 4 Cayley-Klein programmer's wish list

Uniform rep'n for points, lines, and planes

Coordinate-free

2 . 4 Cayley-Klein programmer's wish list

Uniform rep'n for points, lines, and planes

Parallel-safe meet and join operators

Coordinate-free

2 . 4 Cayley-Klein programmer's wish list

Uniform rep'n for points, lines, and planes

Parallel-safe meet and join operators

Single, uniform rep'n for isometries

Coordinate-free

2 . 4 Cayley-Klein programmer's wish list

Uniform rep'n for points, lines, and planes

Parallel-safe meet and join operators

Single, uniform rep'n for isometries

Compact expressions for classical geometric results

Coordinate-free

2 . 4 Cayley-Klein programmer's wish list

Uniform rep'n for points, lines, and planes

Parallel-safe meet and join operators

Single, uniform rep'n for isometries

Compact expressions for classical geometric results

Physics-ready

Coordinate-free

2 . 4 Cayley-Klein programmer's wish list

Uniform rep'n for points, lines, and planes

Parallel-safe meet and join operators

Single, uniform rep'n for isometries

Compact expressions for classical geometric results

Physics-ready

Metric-neutral Coordinate-free

2 . 4 Cayley-Klein programmer's wish list

Uniform rep'n for points, lines, and planes

Parallel-safe meet and join operators

Single, uniform rep'n for isometries

Compact expressions for classical geometric results

Backwards compatible Physics-ready

Metric-neutral Coordinate-free

2 . 4 Partial solutions: Quaternions (1843)

A 4D algebra generated by units {1, i, j, k} satisfying: 12 = 1, i2 = j2 = k2 = −1 ij = −ji, ...

3 . 1 Quaternions

Quaternions H s + xi + yj + zk 3 Im. quaternions IH v := xi + yj + zk ⇔ (x, y, z) ∈ R

Unit quaternions U {g ∈ H ∣ gg = 1}

3 . 2 Quaternions

Quaternions H s + xi + yj + zk 3 Im. quaternions IH v := xi + yj + zk ⇔ (x, y, z) ∈ R

Unit quaternions U {g ∈ H ∣ gg = 1}

I. Geometric product:

v1v 2 = −v1 ⋅ v2 + v1 × v2

3 . 3 Quaternions

Quaternions H s + xi + yj + zk 3 Im. quaternions IH v := xi + yj + zk ⇔ (x, y, z) ∈ R

Unit quaternions U {g ∈ H ∣ gg = 1}

I. Geometric product:

v1v 2 = −v1 ⋅ v2 + v1 × v2

cross product inner product

3 . 3 Quaternions

Quaternions H s + xi + yj + zk 3 Im. quaternions IH v := xi + yj + zk ⇔ (x, y, z) ∈ R

Unit quaternions U {g ∈ H ∣ gg = 1}

II. Rotations via sandwiches: 1. For g ∈ U, there exists x ∈ IH so that g = cos(t) + sin(t)x = etx 2. For any v ∈ IH (≅ R3), the "sandwich"

gvg rotates v around the axis x by an 2t. 3. Comparison to matrices.

3 . 4 Quaternions

Quaternions H s + xi + yj + zk 3 Im. quaternions IH v := xi + yj + zk ⇔ (x, y, z) ∈ R

Unit quaternions U {g ∈ H ∣ gg = 1}

Advantages I. Geometric product II. Rotations as sandwiches

Disadvantages I. Only applies to points/vectors II. Special case R3

3 . 5 Partial solutions: Grassmann algebra

Hermann Grassmann (1809-1877) Ausdehnungslehre (1844)

4 . 1 Grassmann algebra 2 2∗ The wedge (∧) product in RP and RP

4 . 2 Grassmann algebra

4 . 3 Grassmann algebra

Standard projective x ∧ y is join yields ⋀ RP 2

4 . 3 Grassmann algebra

Standard projective Dual projective x ∧ y is join x ∧ y is meet 2 2∗ yields ⋀ RP yields ⋀ RP

4 . 3 Grassmann algebra

The dual projective 2∗ Grassmann algebra ⋀ RP

Grade Sym Generators Dim. Type 0 0 ⋀ 1 1 Scalar 1 1 ⋀ {e0, e1, e2} 3 Line 2 2 ⋀ {Ei = ej ∧ ek } 3 Point 3 3 ⋀ I = e0 ∧ e1 ∧ e2 1 Pseudoscalar

4 . 4 Grassmann algebra

The dual projective 2∗ Grassmann algebra ⋀ RP

Grade Sym Generators Dim. Type 0 0 ⋀ 1 1 Scalar 1 1 ⋀ {e0, e1, e2} 3 Line 2 2 ⋀ {Ei = ej ∧ ek } 3 Point 3 3 ⋀ I = e0 ∧ e1 ∧ e2 1 Pseudoscalar

n∗ We will be using ⋀ RP for the rest of the talk.

4 . 4 Grassmann algebra

The wedge (∧) product in RP 2

Properties of ∧ 1. Antisymmetric: For 1-vectors x, y: x ∧ y = −y ∧ x x ∧ x = 0 2. Subspace lattice: For linearly independent subspaces x ∈ k m k+m ⋀ , y ∈ ⋀ , x ∧ y ∈ ⋀ is the subspace spanned by x and y otherwise it's zero.

Note: The regressive (join) product ∨ is also available. (Then it's called a Grassmann-Cayley algebra.)

4 . 5 Grassmann algebra

Note: spanning subspace means different things in standard and dual setting. In 3D:

Standard: a line is the Dual: a line is the subspace spanned by subspace spanned by two points. two planes.

Plane pencil ange Point r

Spear Axis

4 . 6 Grassmann algebra

Advantages 1. Points, lines, and planes are equal citizens. 2. "Parallel-safe" meet and join operators since projective.

Disadvantages 1. Only incidence (projective), no metric.

4 . 7 Clifford's geometric algebra

William Kingdon Clifford (1845-1879) "Applications of Grassmann's extensive algebra" (1878): His stated aim: to combine quaternions with Grassmann algebra.

5 . 1 Clifford's geometric algebra

Geometric product extends the wedge product and is defined for two 1-vectors as: xy := x⋅y + x ∧ y 0-vector 2-vector where ⋅ is the inner product induced by Q.

Since the two terms measure different aspects, the sum is (usually) non-zero.

This product can be extended to the whole Grassmann algebra ∗ to produce the geometric algebra P(Rp,n,z ) .

5 . 2 Clifford's geometric algebra

Geometric product extends the wedge product and is defined for two 1-vectors as: xy := x⋅y + x ∧ y measures measures sameness 0-vector 2-vector difference where ⋅ is the inner product induced by Q.

Since the two terms measure different aspects, the sum is (usually) non-zero.

This product can be extended to the whole Grassmann algebra ∗ to produce the geometric algebra P(Rp,n,z ) .

5 . 2 Projective geometric algebra

We call an algebra constructed in this way a projective geometric algebra (PGA). ∗ ∗ ∗ We are interested in P(R3,0,0) , P(R2,1,0) , P(R2,0,1) . ∗ We sometimes write P(Rκ) and leave the metric open.

We can choose a fundamental so that: 2 2 2 e0 = κ, e1 = e2 = 1 (κ ∈ {−1, 0, 1})

Ek := eie j = ei ∧ ej = −ej e i

I := e0e 1e 2

5 . 3 2D PGA

2 Example: Two lines, let e0 = κ

a = a0e 0 + a1e 1 + a2e 2

b = b0e 0 + b1e 1 + b2e 2 2 2 2 ab = (a0b 0e 0 + a1b 1e 1 + a2b 2e 2)

+(a0b 1 − a1b 0) e0e 1 + (a1b 2 − a2b 1) e1e 2 + (a0b 2 − a2b 0) e0e 2

= (a0b 0κ + a1b1 + a2b 2)

+(a1b 2 − a2b 1) E0 + (a2b 0 − a0b 2) E1 + (a0b 1 − a1b 0) E2 = a ⋅ b + a ∧ b

5 . 4 2D PGA

2 Example: Two lines, let e0 = κ

a = a0e 0 + a1e 1 + a2e 2

b = b0e 0 + b1e 1 + b2e 2 2 2 2 ab = (a0b 0e 0 + a1b 1e 1 + a2b 2e 2)

+(a0b 1 − a1b 0) e0e 1 + (a1b 2 − a2b 1) e1e 2 + (a0b 2 − a2b 0) e0e 2

= (a0b 0κ + a1b1 + a2b 2)

+(a1b 2 − a2b 1) E0 + (a2b 0 − a0b 2) E1 + (a0b 1 − a1b 0) E2 = a ⋅ b + a ∧ b Looks lik e cross product but is the point incident to both lines.

5 . 4 2D PGA

1 Example: κ = 1 and c = and 2

a = e0, b = ce0 + ce1 Then a2 = b2 = 1. a is the equator great circle z = 0 and b is tilted up from it an angle of 45∘.

ab = c + E2 −1 ∘ Check: cos (c) = 45 and E2 is the common point.

5 . 5 2D Euclidean PGA ∗ We can now explain why P (R2,0,1) is the right choice for the euclidean plane. The inner product of two lines is

a ⋅ b = (a0b 0κ + a1b 1 + a2b 2)

For a euclidean line changing a0 or b0 doesn't change the direction of 2 the line. It just moves it parallel to itself. This means e0 = 0.

5 . 6 Clifford's geometric algebra

0-vector 2-vector

Multiplication table for 2D PGA. κ ∈ {−1, 0, 1}

5 . 7 2D PGA Preliminaries

1. We can normalize a proper line m or point P so that: m2 = 1, P2 = −κ 1a. Elements such that x2 = 0 are called ideal. 1b. Formulas given below often assume normalized arguments.

6 . 1 PGA: 2-way products

2. Multiplication with I: For any k-vector x, x⊥ := xI is the orthogonal complement of x.

Example: e0I = κe1e 2 . The only thing left in I is what isn't in X. 2a. In the euclidean case, I2 = 0.

6 . 2 PGA: 2-way products

2. Multiplication with I: For any k-vector x, x⊥ := xI is the orthogonal complement of x.

Example: e0I = κe1e 2 . The only thing left in I is what isn't in X. 2a. In the euclidean case, I2 = 0.

6 . 2 PGA: 2-way products

3. Product of two proper lines a, b that meet at a proper point P: ab = cos(t) + sin (t)P where t is the angle between the lines (arbitrary κ).

6 . 3 PGA: 2-way products

3a. Product of two proper lines a, b κ = −1, P is hyper-ideal point. Then ab = cosh(d) + sinh(d)P where d is the hyperbolic distance between the lines.

6 . 4 PGA: 2-way products 4. Product of proper line c and proper point Q:

cQ = c ⋅ Q + (cosh d)I (= ⟨cQ⟩1 + ⟨cQ⟩3) The first term is the line through Q perpendicular to c, sometimes written ⊥ aQ . d is the distance from point to line.

6 . 5 PGA: 2-way products

5. Product of two proper points P, Q. Then PQ = cosh(d) + sinh(d)R d is the distance between the two points and R is the normalized form of ⊥ ⟨PQ⟩2 , which is the common orthogonal (P ∨ Q) .

6 . 6 Isometries via 3-way products

Reflections Consider the 3-way product X′ = aXa, where a is a proper line and X is anything. Then X′ is the reflection of X in the line a.

7 . 1 Isometries via 3-way products

Rotations A reflection in a second proper line b gives X′ = b(aXa)b = (ba)X(ab), by associativity. r := ba is called a rotor and X′ = RXR where R is reversal operator.

7 . 2 Isometries via 3-way products

Euclidean translations If κ = 0 and P is ideal, X′ is a translation of distance 2d, where d is the distance betwen a and b. Similar results for κ = −1.

7 . 3 Quaternions in 2D elliptic PGA

For κ = 1, the even sub-algebra (shown in red) is isomorphic to H under the map

{1, E0, E1, E2} ⇔ {1, k, j, i}

7 . 4 Exponentiating bivectors

Every rotor can be produced directly by exponentation of a bivector. When P2 = −1 then r := exp(tP) = cos(t) + sin(t)P rXr produces a rotation through angle 2t around P. Analogous results hold for P2 = 0 or 1 yielding parabolic or hyperbolic isometries. The ideal norm P2 = 0: how to normalize P so edP is a translation of 2d? Time permitting ...

7 . 5 and

2 The bivectors ⋀ form the Lie algebra. Define G to be the elements of the even sub-algebra of norm 1. Then G is the Lie group. 2 And exp : ⋀ → G is a 1:1 map up to multiples of 2π (for n = 3).

7 . 6 Formula factories via 3-way products

3-way products with a repeated factor of the form YXX can be used as formula factories. Example: m = m(nn) = (mn)n since for a proper line n2 = 1 and associativity. This leads to a decomposition of m with respect to n: (mn)n = (cos(α) + sin(α)P)n = cos(α)n + sin(α)P n = cos(α)n + sin(α)P ⋅ n = cos(α)n − sin(α)n ⋅ P

The arrows show the orientation of the lines.

7 . 7 Formula factories via 3-way products

Examples: Anything can be orthogonally decomposed with respect to anything else! For example ...

Decompose point WRT line. Decompose line WRT point.

The pieces of the decomposition are often interesting in their own right. For example, (P ⋅ m)m is closest point to P on m.

7 . 8 Formula factories via 3-way products

General 3-way products abc of 1-vectors provide a useful framework for a general theory of . Lots left to do!

7 . 9 2D PGA in the browser

A euclidean demo from Steven De Keninck, using his ganja.js Javascript implementation, showing several of the features discussed above.

ℓ = line (vector)

P = point (bivector)

ℓP = line through P , ⊥ to ℓ https://enkimute.github.io/ganja.js/exa mples/coffeeshop.html#iAdRREx- ℓP ℓ = reflection of P in ℓ M&fullscreen P ℓP = reflection of ℓ in P

(ℓ ⋅ P )ℓ = projection of P on ℓ

(P ⋅ ℓ)P = projection of ℓ on P

These slides are available at https://slides.com/skydog23/icerm2019/live

7 . 10 Glimpse at 3D Bivectors!

Julius Pluecker

8 . 1 Glimpse at 3D Bivectors!

Julius Pluecker

8 . 1 Glimpse at 3D

8 . 2 Kinematics and Mechanics

2 A velocity state is V ∈ ⋀ (in this case a point) n−2 A momentum state is M ∈ ⋀ (in this case a line) A rigid body is a collection of Newtonian mass points. Calculate inertia tensor A for the body, a quadratic form determined by the mass distribution. M = AV ODE's for free top: ∗ PGA equations for the free top in P (Rκ):

g˙ = gV 1

M˙ = (VM − MV) 2 where g ∈ G, and M and Vare in the body frame.

9 . 1 2D Kinematics and Mechanics

Advantages of PGA: 1. Euclidean case: No splitting into linear and angular parts. A linear velocity is a velocity carried by an ideal point (euclidean). An angular momentum (or force couple) is one carried by the ideal line. 2. Similar results hold in 3D. 3. The equations are numerically optimal compared to matrix methods. Normalizing g keeps it on the solution space.

9 . 2 2D Kinematics and Mechanics

https://player.vimeo.com/video/358743032?api=1

9 . 3 3D Kinematics and Mechanics

9 . 4 3D Poinsot motion (?)

9 . 5 Cayley-Klein programmer's wish list

10 . 1 Cayley-Klein programmer's wish list

Uniform rep'n for points, lines, and planes

Parallel-safe meet and join operators

10 . 1 Cayley-Klein programmer's wish list

Uniform rep'n for points, lines, and planes

Parallel-safe meet and join operators

Metric-neutral

10 . 1 Cayley-Klein programmer's wish list

Uniform rep'n for points, lines, and planes

Parallel-safe meet and join operators

Single, uniform rep'n for isometries

Compact expressions for classical geometric results

Metric-neutral

10 . 1 Cayley-Klein programmer's wish list

Uniform rep'n for points, lines, and planes

Parallel-safe meet and join operators

Single, uniform rep'n for isometries

Compact expressions for classical geometric results

Physics-ready

Metric-neutral

10 . 1 Cayley-Klein programmer's wish list

Uniform rep'n for points, lines, and planes

Parallel-safe meet and join operators

Single, uniform rep'n for isometries

Compact expressions for classical geometric results

Backwards compatible Physics-ready

Metric-neutral

10 . 1 Cayley-Klein programmer's wish list

Uniform rep'n for points, lines, and planes

Parallel-safe meet and join operators

Single, uniform rep'n for isometries

Compact expressions for classical geometric results

Backwards compatible Physics-ready

Metric-neutral Coordinate-free

10 . 1 Conclusions

Dual PGA fulfills the "programmers wish list" from the beginning. It completes Clifford's project (cut short by his death) of combining Grassmann algebra with all biquaternions, not just the elliptic ones. There's a lot left to explore, both in non-euclidean and euclidean, 2D and 3D. Team members sought to create browser-based metric-neutral PGA scene graph with physics engine. Ask me about ideal norms and dual .

10 . 2 Resources

Javascript implementation Steven De Keninck ganja.js

10 . 3 10 . 4 Resources

Metric-neutral resources My Ph. D. thesis ganja.js

Euclidean resources

bivector.net/doc SIGGRAPH 2019 course notes & cheat sheets & course videos + more. Live 2D and 3D PGA demos in JavaScript My ResearchGate PGA project

Questions and comments: projgeom at gmail.com Thanks for your attention!

10 . 5 's all folks That

10 . 6 Partial solutions: Quaternions

Quaternions H s + xi + yj + zk 3 Im. quaternions IH v := xi + yj + zk ⇔ (x, y, z) ∈ R

Unit quaternions U {g ∈ H ∣ gg = 1}

III. ODE's for Euler top: Quaternion equations for the Euler top in R3:

g˙ = gV ˙ 1 M = (VM − MV) 2 where g ∈ U and M, V ∈ IH are the momentum, resp., velocity vectors in the body frame. (M = AV for inertia tensor A).

11 . 1 Dual projective Grassmann algebra

2∗ Multiplication table for ⋀ RP

11 . 2 Geometric algebra notation

General multivector is sum of k-vectors: a = Σk⟨ a⟩k Points are large letters (P) and lines are small (m). The unit pseudoscalar is written I. The product of a k-vector and an m-vector is a sum k+m KM = Σi=∣k−m∣⟨ KM⟩i where i increases by steps of 2.

K ∧ M = ⟨KM⟩k+m

K ⋅ M := ⟨KM⟩∣k−m∣ K × M := KM − MK K ∨ M is the join.

11 . 3 ∗ The euclidean algebra P(R2,0,1)

Question: Why is the signature (2, 0, 1) using the dual construction the proper model for the euclidean plane?

Answer: Given two lines mi = cie 0 + aie 1 + bie 2 (with

equations aix + biy + ci = 0). Then 2 2 2 m1 ⋅ m2 = c0c 1e 0 + a1a 2e 1 + b1b 2e 2

Since the cosine of the angle between the lines is a1a 2 + 2 2 2 b1b 2 , e0 = 0 while e1 = e2 = 1.

11 . 4 ∗ The euclidean algebra P(R2,0,1)

Question: Why is the signature (2, 0, 1) using the dual construction the proper model for the euclidean plane?

Answer: Given two lines mi = cie 0 + aie 1 + bie 2 (with

equations aix + biy + ci = 0). Then 2 2 2 m1 ⋅ m2 = c0c 1e 0 + a1a 2e 1 + b1b 2e 2

Since the cosine of the angle between the lines is a1a 2 + 2 2 2 b1b 2 , e0 = 0 while e1 = e2 = 1.

∗ History: That P(R2,0,1) models was first published by Jon Selig in 2000.

11 . 5 Question

What is the best way to do Cayley-Klein geometry on the computer?

11 . 6