Snell's law
nair sin i = n sin r, nair ≈ 1
One internal reflection
α(i) = 4r − 2i
Stationary deviation
sin² i* = (4 − n²) / 3
A finite primary-rainbow caustic exists in this model only for 1 < n < 2. The code also traces rays through the actual circular boundary using vector refraction and reflection; it does not draw the path from the closed-form angle alone. Because the circle intersections are solved directly, no time-dependent ODE integration is needed. The visual pulse advances with a fixed 1/60 s step and does not represent light-travel time.
What is held fixed: a spherical, homogeneous, transparent droplet; air outside; one internal reflection; geometric optics; and a single 589 nm wavelength. Droplet diameter changes the drawing scale only. Dispersion, wave interference, polarisation, absorption, and finite solar size are omitted.
This is an independent educational simulation and is not affiliated with a university, museum, or optical manufacturer.