# mathr / blog / #

## Reflex preview

What Reflex does first is: given a {p,q,r} specification of a 4D polytope, calculate the fundamental region (being a collection of 4 planes through the origin), from which calculate the symmetry group (being the group closure of the reflections in those planes).

What Reflex does next is: given four non-negative numbers (being the relative distances from the planes bounding the fundamental region), find the point thus represented, further find additional points at the centres of neighbouring 1-lines, 2-surfaces and 3-solids, and then find all images of that figure under the action of the symmetry group.

What Reflex finally does is a stereographic projection to 3D, assuming the original 4D figure is in the surface of a sphere, followed by a normal perspective projection to 2D - with a selection of the figures' subcomponents displayed (currently each of the six 2-surfaces can be toggled on/off - earlier versions did the same with the four 1-lines).

Reflex runs in realtime at reasonable frame rate and CPU usage provided I turn off the interpolation completely (which stops the curves being so smooth, alas) and don't try to render the mammoth {5,3,3} (which has a symmetry group with 14400 elements).

But nothing new under the sun, essentially this is all just a clone of The Symmetriad. I might write up some of the maths in an article later, meanwhile you can find the totally undocumented code in my mess of a Subversion repository:

svn co https://code.goto10.org/svn/maximus/2009/dualist reflex

(Hint: you need to generate the .4d files first, then ./reflex-jack.sh will fire up a Pd GUI to send commands to Reflex. SuperBonusPoints for anyone who gets it working, like the title says, just a preview...)