Back to Blog
Physics

Wave Optics in Your Browser: Interference, Diffraction, and Snell's Law

July 11, 2026 5 min read SciFunLab Team

From bending light through a prism to ripple tank interference patterns, explore wave and geometric optics through free interactive simulations on SciFunLab.

Light does two things that seem almost contradictory. It travels in straight rays — you can block it with a sheet of paper. And it bends around corners, splits into colors, and cancels itself out entirely when two beams meet. Both behaviors are real; they just show up at different scales. These simulations let you explore both.

Bending Light: Snell's Law in Action

Open Bending Light and drag a ray of light into a glass block. The ray bends at the surface, and immediately you can see why the formula n₁ × sin(θ₁) = n₂ × sin(θ₂) is more than an equation — it's a precise description of how much bending happens based on the optical density of each medium.

The index of refraction tells you how much slower light travels in that material compared to vacuum. Glass has n ≈ 1.5, so light slows to about two-thirds of its free-space speed. Water is n ≈ 1.33. When light crosses the boundary from a denser material to a less dense one at a steep enough angle, it can't refract at all — it reflects entirely back. This is total internal reflection (TIR), and it's why fiber optic cables work.

Drag the angle of incidence past the critical angle (θ_c = arcsin(n₂/n₁)) and you'll see the refracted ray disappear — the transmitted beam vanishes and the reflection becomes perfect.

Switch to the prism mode. White light enters as a single beam and exits as a rainbow. Each wavelength has a slightly different index of refraction in glass, so each bends by a slightly different angle — dispersion. Red bends least, violet bends most. This is exactly what Newton proved with a prism in 1666, and you can reproduce it in about 30 seconds.

Geometric Optics: Building Images with Lenses

The Geometric Optics simulation focuses on the thin lens equation: 1/f = 1/do + 1/di, where f is focal length, do is object distance, and di is image distance.

Place a converging lens and move an object around it. When the object is beyond 2f, the image forms on the other side, smaller and inverted — this is how a camera works. Bring the object inside f and the image flips: it becomes virtual, upright, and magnified. That's a magnifying glass.

The simulation draws the three principal rays explicitly: the ray through the center (undeviated), the ray parallel to the axis (bends through the focal point), and the ray through the near focal point (exits parallel). Their intersection — or apparent intersection for virtual images — shows you where the image forms. Watching how these three rays always agree, even as you drag the object around, makes the lens equation feel inevitable rather than arbitrary.

Negative lenses (diverging) are included too. They always form virtual, reduced images regardless of object position, which is why they're used in corrective lenses for nearsightedness.

Reflection and Fresnel Equations

The Reflection simulation goes deeper than "angle of incidence equals angle of reflection." At every interface, some light reflects and some transmits, and the fraction depends on the polarization of the light and the angle of incidence. These are the Fresnel equations.

At one specific angle — Brewster's angle, given by θ_B = arctan(n₂/n₁) — the p-polarized component (parallel to the plane of incidence) reflects with zero intensity. Only the s-polarized component reflects. This is why polarized sunglasses cut glare from water: reflected sunlight is almost entirely s-polarized, and the glasses block that orientation.

Adjust the angle slider and watch the reflectance curve. At normal incidence (straight on) you get about 4% reflection from glass. Near grazing incidence (nearly parallel to the surface) you approach 100%. The smooth curve between these extremes is the Fresnel equation at work.

Ripple Tank: Two-Slit Interference

The Ripple Tank simulation is where wave optics gets dramatic. Two point sources emit circular waves at the same frequency. Where wave crests meet, they add — constructive interference, bright regions. Where a crest meets a trough, they cancel — destructive interference, dark lines.

The condition for constructive interference is that the path difference from the two sources equals a whole number of wavelengths: Δr = mλ, where m = 0, ±1, ±2, ...

Destructive interference occurs at Δr = (m + ½)λ.

Move the two sources closer together and the interference bands spread apart. This is exactly what Young's double-slit experiment demonstrated in 1801 — light behaves like a wave. Measure the fringe spacing and the source separation, and you can calculate the wavelength. The ripple tank makes this relationship geometric and obvious.

Wave on a String: Standing Waves and Harmonics

The Wave on a String simulation shifts from light to mechanical waves, but the core physics is the same.

Drive one end of a string at a fixed frequency. At most frequencies, the wave just travels and reflects messily. But at specific resonant frequencies, something changes: the rightward wave and its reflection reinforce each other perfectly, creating a standing wave with fixed nodes (points of zero displacement) and antinodes (maximum displacement).

The resonance condition is L = nλ/2, where L is the string length and n is a positive integer. Each value of n is a harmonic: n = 1 is the fundamental (one antinode), n = 2 is the second harmonic (two antinodes), and so on. Change the tension and watch the resonant frequencies shift — higher tension means faster wave speed, which means higher frequencies hit resonance.

This same physics governs guitar strings, organ pipes, and the vibrational modes of bridges. The simulation makes the node and antinode pattern visible in real time.

Why These Five Belong Together

These simulations span a range from geometric ray tracing to full wave phenomena, but they share a thread: light (and waves generally) follow precise mathematical rules, and those rules produce effects that seem almost magical until you understand the geometry. A rainbow is dispersion. A dark fringe in an interference pattern is cancellation by path difference. Total internal reflection is Snell's law taken to its limit.

The equations are simple. What takes time is building the intuition for what they predict — and that's exactly what these simulations accelerate.

Try them:

All free, no account needed.

More Physics Articles