...
running...
The science
The pattern's symmetry is the mathematical dihedral group D_N: N rotations by 2πk/N about the centre, and, when mirrored, N reflections across lines through the centre. A point (x, y) relative to the centre is mapped to
R_k(x,y) = (x cosαₖ − y sinαₖ, x sinαₖ + y cosαₖ), αₖ = 2πk/N M(x,y) = (x,−y)
The group has |D_N| = 2N elements; rotations alone form the cyclic group C_N of order N. Composing two reflections gives a rotation by twice the angle between their mirror lines, which is why a physical kaleidoscope with two mirrors at angle π/N produces the N-fold dihedral pattern. Properties: R_N = identity, M·M = identity, and M R_k M = R_{−k}.
Simplifications: the drawing is made by direct canvas strokes, not by optical ray tracing between real mirrors, so there is no multiple-reflection brightness loss. The numerical check verifies the group axioms on random points and counts transformed copies.
What is checked and why you can trust it
Every time the page loads, and whenever you press Re-run check, the simulation evaluates its own mathematics against an independent reference, such as a closed-form formula, a finite-difference derivative or an exhaustive count. Each line above reports PASS or FAIL together with the measured numbers, so you can see by how much it agrees. Results are also published on window.__msChecks for automated testing. The check never uses the same code path as the animation it validates, otherwise it would only confirm itself.
How to read a failure: a FAIL line means the measured discrepancy exceeded the stated tolerance for the current slider values. Try Reset, then move the sliders back toward their defaults; if a check still fails at the defaults it is a bug worth reporting. Tolerances are chosen from the numerical method itself, never tuned to make a test pass: round-off level (1e-9) for exact algebra, about 1e-3 for finite differences and Monte Carlo estimates with a few hundred thousand samples, and a documented margin for stochastic learning runs.
Reproducibility: the particle and pen simulations use the browser random generator for initial positions, so exact pixels differ between visits, but the checks depend only on mathematics and not on those positions. Fixed wave tables (curl noise) and fixed grammars (L-system) are deterministic.
This is an educational model. It shows the mechanism clearly, but it is deliberately simplified; the science panel lists what was left out.