PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

More from Optics & Light

Other simulators in this category — or see all 44.

View category →
NewSchool

Rayleigh Sky (blue)

Scattered intensity ∝ λ⁻⁴; compare blue vs red and qualitative sky gradient.

Launch Simulator
NewSchool

Inferior Mirage (hot road)

n(y) gradient above hot asphalt: rays bend — sky light looks like a wet patch.

Launch Simulator
School

Reflection

Flat, concave, and convex mirrors with auto-drawn ray diagrams.

Launch Simulator
FeaturedSchool

Refraction

Light crossing boundaries. Snell's law with angle measurements.

Launch Simulator
School

Total Internal Reflection

Find the critical angle. Fiber optics analogy.

Launch Simulator
FeaturedSchool

Lens Simulator

Converging and diverging lenses with ray diagrams and image formation.

Launch Simulator
PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Optics & Light/Rainbow in a Droplet

Rainbow in a Droplet

Rainbows are a classic demonstration of geometric optics, arising from sunlight interacting with countless spherical water droplets. This simulator distills the phenomenon into ray paths inside a single sphere: sunlight refracts into the droplet, undergoes one or two internal reflections at the back surface, then refracts out. Snell's Law, n₁ sin θ₁ = n₂ sin θ₂, sets the bending at each air–water interface. The impact height (distance of the incoming ray from the droplet axis) controls the entire trajectory; the total deviation angle varies non-linearly with that parameter. Near its minimum, many rays with nearby impact parameters exit in nearly the same direction, producing the bright primary bow (~42° for water) after one internal reflection. A second, dimmer family with two internal reflections forms the secondary bow at a larger deviation (~51°); dispersion makes the color order appear reversed compared with the primary. You can toggle primary, secondary, or both paths, and scan water index n and normalized impact height b/R. The model remains geometric: it omits Mie scattering, supernumerary interference fringes, strong polarization effects, and the full ensemble of droplets in the sky.

Who it's for: High school and introductory undergraduate physics students studying geometric optics, particularly those covering Snell's Law, total internal reflection, and the formation of rainbows.

Key terms

  • Snell's Law
  • Refraction
  • Internal reflection
  • Refractive index
  • Angle of minimum deviation
  • Primary rainbow
  • Secondary rainbow
  • Geometric optics

Optics

1.33
0.72

Parallel rays at different impact heights have different deflection angles; color spread comes from n(λ). The primary bow (~42°) uses one internal reflection; the dimmer secondary (~51°) uses two — spectrum order reverses on the secondary.

Measured values

Primary |Δθ|38.4°
Secondary |Δθ|77.5°

How it works

Geometric optics in a spherical drop: Snell at entry and exit with one or two internal reflections — primary and secondary rainbow families (not a full Mie simulation).

Frequently asked questions

Why is there a bright band at a specific angle? Why don't we see light at all angles?
The deviation angle—the total bend a light ray undergoes—changes with impact height. Near the angle of minimum deviation, many rays with slightly different impact heights exit at nearly the same angle. This 'bunching up' of rays creates a high intensity, bright band. At other angles, rays are more spread out, resulting in much dimmer light.
Does the simulator show why a rainbow has different colors?
Indirectly, yes. The refractive index (n) depends on the color (wavelength) of light; violet light bends more than red light. In the simulator, you can mimic this by increasing 'n' to see how the rainbow angle decreases. In reality, white sunlight contains all colors, and each color reaches its minimum deviation at a slightly different angle, creating the colored bands.
What is the 'impact height' and why is it important?
The impact height is the distance from the droplet's central axis where the incoming light ray strikes. It determines the initial angle of incidence inside the droplet. This single parameter controls the entire subsequent path of the ray—its refraction, reflection point, and final exit angle—making it the key variable for tracing the ray's fate.
What does this model still leave out about real rainbows?
It is still a single-droplet, ray-optics sketch. Real bows involve countless droplets, Mie scattering for small drops, pronounced polarization, supernumerary arcs from wave interference, and atmospheric effects. The simulator shows the correct primary vs secondary ray sequences but not intensity distributions or the full spectrum.