Kaleidoscope
Draw with your mouse and watch dihedral symmetry replicate your strokes across mirror segments. A kaleidoscope applies the symmetries of a regular polygon — rotations and reflections — to transform a single gesture into a mesmerizing mandala.
Symmetry group Dn — n rotations × 2 (with reflections) = 2n symmetries
Dihedral symmetry
A kaleidoscope with n mirror segments implements the dihedral group Dn, the symmetry group of a regular n-gon. This group has 2n elements: n rotations (by multiples of 2π/n) and n reflections. Every stroke you draw is replicated across all 2n symmetries simultaneously.
How it works
Your mouse position is converted to polar coordinates relative to the canvas center. For each of the n segments, the angle is rotated by 2πk/n. Every other segment is reflected (the angle is negated before rotation), producing the full dihedral symmetry. The result: a single freehand stroke becomes a mandala.
Mathematical structure
Dn is generated by two elements: a rotation r by 2π/n and a reflection s. They satisfy rn = s2 = (sr)2 = identity. For n = 6, this is the symmetry of a snowflake. For n = 8, a stop sign. The kaleidoscope makes these abstract group elements tangible.