Atmospheric light scattering demonstrates how rainbows form. Sunlight refracts through water droplets, separating into the colour spectrum. Move the sun position to see how the rainbow angle changes.
Snell's law governs refraction at the droplet surface. Different wavelengths refract at slightly different angles (dispersion), separating white light into colours.
Move the sun position to see how the rainbow arc responds. The primary rainbow is always at 42° from the anti-solar point.
The secondary rainbow (sometimes visible outside the primary) has reversed colour order and is caused by two internal reflections inside the droplet. The dark band between them is called Alexander's dark band.