loading...
Probe ray. Left: unfolded, the ray is one straight line through the mirror copies. Right: the same ray bouncing inside the real wedge.
Copies of each glass piece against the wedge angle: formula 360 / alpha (blue) and counted by reflecting a point (green dots)
Why must the wedge angle be 180 degrees divided by a whole number? Press the button and read what reflecting a point in two mirrors gives for several angles.
running...
The science
The mirror pair. Two plane mirrors meet along the axis of the tube at the angle alpha. A viewer looking along a long tube sends rays that move almost parallel to the axis, so only their sideways motion matters: in the plane of the end cell each ray is a straight segment that is reflected whenever it meets a mirror line. A reflection across a line through the origin at angle b is
R_b(x, y) = (x cos 2b + y sin 2b, x sin 2b - y cos 2b)
and two reflections across mirrors that differ by alpha give a rotation by 2 alpha (checked in the page).
Unfolding. Instead of reflecting the ray, reflect the wedge: the ray becomes one straight line crossing a fan of mirror-image wedges. Where the unfolded ray ends, the folded ray ends at the angle
phi' = (phi mod 2 alpha) if that is at most alpha, else phi' = 2 alpha - (phi mod 2 alpha)
and the radius is unchanged. The number of bounces is the number of sector boundaries crossed, floor(phi_end / alpha) - floor(phi_start / alpha) for a ray that does not pass through the apex. The page traces rays by explicit reflection and compares them with this formula.
Copies. The images of one object generated by the two mirrors form the dihedral group. If alpha = 180 deg / n with a whole n the copies fit together exactly and there are 360 deg / alpha = 2n of them (the object plus 2n - 1 images); copy number j has been reflected min(j, 2n - j) times. For any other angle the images overlap and contradict each other, which is why real kaleidoscopes use 60, 45, 36, 30 degrees and so on. If the mirrors have reflectivity rho a copy that bounced k times has brightness rho^k.
The cell. The coloured pieces are small discs and shards in a round glass cell. Between the glass plates they move as 2D rigid discs: gravity g, elastic or inelastic collisions with the impulse J = -(1 + e) m_eff v_n along the line of centres, and a wall that turns at the tube rate omega and drags pieces tangentially (a simple viscous grip, not Coulomb friction). Integration is a fixed 1/240 s leapfrog step, exact for constant gravity. The light source is behind the cell, so each piece multiplies the background colour like stained glass.
Honest simplifications. (1) The parallel-view limit: a real eye at a finite distance sees a slightly different, perspective-curved picture, and a short tube cuts off some rays at the open end. (2) The mirrors are perfect planes with one constant reflectivity, no colour shift and no double image from the glass backing. (3) Pieces are flat 2D shapes: no refraction inside thick glass and no depth blur. (4) Gravity is scaled up for visibility: with a real cell of about 1.5 cm radius, g would be near 650 cell radii per second squared. (5) Pieces that overlap in real life stack in depth; here they just overlap. (6) In the 3D scene the screen next to the tube shows exactly the same computed picture; the tube is a model, the mirrors are drawn at the chosen angle.
Checks run in the page. Specular ray tracing against the analytic fold for thousands of random rays; bounce counts against sector crossings; the number of images found by repeated reflection against 360/alpha for n = 2 to 16 and for the current wedge; two reflections against a rotation by 2 alpha; free fall of a piece against g t^2 / 2; and momentum and kinetic energy conservation in an elastic two-piece collision.