Symmetry groups in the plane
A finite figure can only have rotations about one point and mirrors through it; a strip pattern has one of seven frieze groups; a pattern repeated in two directions has one of seventeen wallpaper groups. Give a pattern exactly and the library finds its group.
figureSymmetry(regularPolygon(5)).name; // "D5": 5 rotations, 5 mirrors
friezeGroup({ points, period: 1 }); // { name: "p2mg", conway: "spinning sidle", … }
wallpaperGroup({ gram: [[1, 0], [0, 1]], points }); // { name: "p4g", orbifold: "4*2", steps }
wallpaper.pattern("p31m", [["1/7", "2/11"]]); // a pattern with that group
Rosettes
Every symmetry of a finite figure fixes its centroid, so the symmetry group is finite and, as Leonardo da Vinci noticed, is either cyclic, (n rotations), or dihedral, (n rotations and n mirrors). figureSymmetry(points) tries the rotation and the reflection that take one point to each other point at the same distance from the centre, keeps those that map the whole figure to itself exactly, and returns them as Transforms and as a PermGroup on the points. Labels keep points of different kinds apart.
Friezes
A frieze is a pattern repeated along a line by one translation. Its symmetries keep the strip, so they can only be: a mirror along the centre line, mirrors across it, half-turns about points of it, and a glide reflection (reflect in the centre line and move half a period). Which of these occur decides the group, one of seven, given here in crystallographic notation with Conway's names: p1 hop, p11g step, p1m1 sidle, p2 spinning hop, p2mg spinning sidle, p11m jump, p2mm spinning jump. Give the points of one period; the centre line is the middle of their heights, and the candidate mirrors and centres come from pairs of points, so the search is finite and exact.
Wallpaper groups
A wallpaper pattern is repeated by a lattice of translations. Write its points in lattice coordinates (fractions of the two basis vectors) and give the shape of the lattice by its Gram matrix . The hexagonal lattice has Gram matrix , rational although the vectors are not, so everything stays in rationals.
A symmetry is where M is an integer matrix that keeps the Gram matrix (a rotation or reflection of the lattice) and t is found by sending one point to another. By the crystallographic restriction, rotations have order 1, 2, 3, 4 or 6. The group is then named by the usual flowchart:
- the highest order of rotation;
- whether there are mirrors, and in how many directions;
- whether some glide reflection has an axis that is not a mirror, which happens when its glide vector is not a lattice vector;
- whether the centres of rotation lie on mirrors, where a centre c is on a mirror when some reflection fixes it: is a lattice vector.
The answer comes with each step of the flowchart and with Conway's orbifold symbol. wallpaper.pattern(name, seeds) goes the other way: it applies the standard generators of a group to a few points and returns a pattern. The tests run all seventeen round the circle, and check that moving the origin or changing the lattice basis does not change the answer.
| call | returns |
|---|---|
| figureSymmetry(points, { labels }) | { name, order, rotations, reflections, center, transforms, group } |
| friezeGroup({ points, period, labels }) | { name, conway, orbifold, horizontalMirror, verticalMirror, halfTurn, glide, … } |
| wallpaperGroup({ gram, points, labels }) | { name, orbifold, pointGroupOrder, symmetries, steps } |
| wallpaper.names, wallpaper.pattern(name, seeds), friezes | The seventeen and the seven |
@ratmath/geo and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.