Making examples for an upcoming open source release :)
Every geometry library needs an orthographic projection cube example, right?
I’m not sure how this #Clojure program could be shorter without losing generality. 🤔

Using CGA (conformal geometric algebra) to find the circumcircle that fits three moving points…

https://en.wikipedia.org/wiki/Conformal_geometric_algebra

#geometer

Using PGA2D (2D Plane-based Geometric Algebra) to explore wallpaper groups. (Still making examples for this library 😆.)

https://en.wikipedia.org/wiki/Plane-based_geometric_algebra

#geometer

Wallpaper group p6: hexagonal lattice, cn-symmetry 6, tiling a decahedron.
#clojure #geometer

(This is @csk's territory, but I'm visiting atm because PGA makes this sort of thing so elegant.)

Here’s an example of a motor in PGA3D creating a spiral of triangles.

A motor is a multivector that combines a rotor (specifies a 3D rotation) with a translator (specifies, naturally enough, a 3D translation). You can then apply this multivector to another to do both at the same time. Clojure's `iterate` is a pleasure here:

(take steps (iterate (fn [s] (map #(transform % motor) s)) shape))

#geometer

@jack I previously watched your talk about GA. For my part, I'm still not sure how to exploit a possible connection to patterns and tilings. It's cool that you're making that connection.

Interestingly, my colleague in the computer graphics lab, Stephen Mann, does a lot of research on CGA and PGA, and co-authored a textbook on the subject. I should pick his brain about connections.

@csk In this case it’s just an example for a library I’m getting ready to release. The thing that makes it elegant for this purpose is that reflections and rotations are very easy to specify in PGA. Multiplying a point by a line returns the point reflected over the line, for example.
@jack Yes, the notation is hard to beat! The trouble tends to come in the implementation, where a naive representation of geometric objects tends to require an exponential number of coefficients. I assume there's some nice research to be done in compilation methods for GA that perform static type inference on the objects being processed (which are usually quite tame) and emit efficient code. I haven't looked too hard to see what's already been done in this context.

@csk My library currently has pretty fat arrays for the multivectors, but at least avoids computing the coefficients that always yield zero, &c, so it’s not *miserably* slow.

As you guessed, there are some nice per-algebra tricks, but for the general case using computer algebra techniques to simplify expressions and compile them on the fly is the best way I’ve seen (and I might end up there if I start having perf probs).

@jack Wow, I really need to learn GA some day!

@jack If I squint, I see these vague connections between algorithms when I program geometric things* and from what I gather, GA could present a lot of these things in a more "natural form" (?). I've found it difficult to get into though.

*For example, there seems to be something very similar between computing the Voronoi triangulation in 2d using incremental edge flipping and computing the convex hull of a 3d point set using the "incremental point inclusion and flipping of edges" approach. I know there is a connection between the 3d convex hull and 2d Voronoi triangulation, but what I found interesting is that it seems to be _easier_ to compute e.g. the Voronoi tetrahedrization in Nd by using the convex hull algorithm in (N+1)d - there are less corner cases! (Maybe because the projection from N+1 to Nd in the end gets rid of what the corner cases in Nd tried to work around) I haven't had the time to explore this in detail, however.

@gustav There are many situations where adding a dimension makes things easier, yeah. GA is great. I’m tidying up a GA library in Clojure for release right now, maybe that will be a way into it for you? 😊
@jack That sounds perfect, I will keep an eye out for the release!