Science Lab · Physics
Optics Bench
A light table with a laser, a lamp, a patch of sunlight, mirrors, lenses, a glass block, a prism and one very large raindrop. Drag the pieces around and the rays follow instantly, bending at every glass surface by Snell's law. Focus the Sun, trap a beam inside glass, split white light into colors, and find the angle where every rainbow lives.
Scenes
Add to the bench
Selected
Nothing selected. Tap a piece on the bench.
Live numbers
Missions
Keys, with the bench selected: arrows move the selected piece (Shift for bigger steps), Q and E turn it, N picks the next piece, Delete removes it, A turns the angle labels on or off.
What you're seeing
The dark table is seen from above, with a grid of 5 cm squares and a centimeter ruler along the bottom. Each bright line is a ray: the path one thin pencil of light takes. A laser sends out one ray, a lamp sends a fan of rays from one point, and sunlight arrives as parallel rays, because the Sun is so far away.
Sunlight and the "white" lamp and laser are traced as nine colors from violet (410 nm) to deep red (680 nm). Where the nine colors overlap they add up to white. Where glass sends them in slightly different directions, you see them come apart.
At every glass surface some light goes through and bends, and a little bounces back. The faint rays are those partial reflections; turn them off with ◐ if they clutter the view. The screen catches light, and its strip in the corner shows what you would see on it.
The raindrop is drawn huge. A real one is about a millimeter across, but the angles of the light through it don't depend on its size, so the rainbow angle comes out the same.
The science
Reflection
A mirror sends light back at the same angle it arrived. Both angles are measured from the normal, a line standing straight out of the surface (the dashed lines in the simulation):
Refraction and Snell's law
Light travels slower in glass or water than in air. The ratio is the refractive index, n = c / v, where c = 299,792,458 m/s is the speed of light in a vacuum. In ordinary BK7 glass, n = 1.517, so light moves at about 198,000 km/s; in water, n = 1.333, about 225,000 km/s. When a beam crosses a surface at a slant, the slowdown swings it toward the normal, like a cart that rolls from pavement onto grass with one wheel first. The rule, found by Willebrord Snell in 1621, is:
Example: a beam hits BK7 glass at θ1 = 40°. Then sin θ2 = sin 40° / 1.517 = 0.424, so θ2 = 25.1°. When it leaves through a parallel face, the same rule turns it back to 40°: it comes out parallel to where it went in, shifted sideways.
Partial reflection
Every glass surface reflects a little. Head-on, the fraction reflected is
That is 4.2% for BK7 glass and 2.0% for water, which is why you can see your reflection in a window at night. At a glancing angle the reflection grows, up to 100% as the beam skims the surface. The simulation works this out with the Fresnel equations at every surface.
Total internal reflection
Going from glass into air, light bends away from the normal. Past the critical angle θc it can't get out at all, and all of it reflects back inside:
For BK7 glass into air θc = 41.2°, for water 48.6°, for dense SF11 flint glass 34.1°. Optical fibers use this: light zigzags along a thin glass thread, kilometers long, with almost nothing leaking out of the sides.
Lenses and focal length
A convex lens is thicker in the middle. Rays that pass farther from the center hit its curved faces at a bigger slant, so they bend more, and parallel rays come together near one point, the focus. Its distance from the lens is the focal length f. For a lens of index n with faces of radius R1 and R2, the lensmaker's equation gives it:
Here d is the lens's thickness; for a thin lens the last term is dropped. The bench's convex lens has both faces of radius 20 cm and is 1.47 cm thick, so f = 19.35 cm from the thin formula and 19.60 cm with the thickness included. The panel shows both, plus the focal length measured by tracing a ray close to the axis through the real glass surfaces.
A lens also makes images. Light from each point of an object meets again at one point on the far side. The object distance do and the image distance di, both measured from the lens, follow the thin-lens equation, and the image is flipped and scaled by the magnification m:
A concave lens spreads light out instead, as if it came from a focus in front of the lens; its focal length is negative. A curved mirror focuses too, at half its radius: f = R/2.
Real lenses with round faces are not perfect. Rays through the edge focus a little closer than rays near the middle (spherical aberration), so a beam of sunlight never quite comes to a point. Switch to Ideal thin lens to see what a perfect lens would do, then switch back.
Dispersion: why prisms make colors
The refractive index depends on the color (wavelength) of the light: violet slows down more than red, so it bends more. Glass makers measure this and publish it as a formula. The simulation uses the Sellmeier formula with the coefficients from SCHOTT's data sheets:
| Material | violet 404.7 nm | yellow 587.6 nm | red 656.3 nm | critical angle |
|---|---|---|---|---|
| BK7 crown glass | 1.5302 | 1.5168 | 1.5143 | 41.2° |
| SF11 dense flint glass | 1.8424 | 1.7847 | 1.7760 | 34.1° |
| Water, 20 °C | 1.3428 | 1.3330 | 1.3312 | 48.6° |
A prism bends light twice in the same direction, so the colors fan out. Turned just right, a prism bends the light by the least amount (the minimum deviation D), and the index can be read from it. For a 60° prism at 589 nm this is 38.6° for BK7 and 66.3° for SF11. SF11 also fans the colors out far more: violet (405 nm) and red (656 nm) leave 9.7° apart, against 1.4° for BK7.
Rainbows
Sunlight enters a raindrop, reflects once off the back, and comes out again. Rays that enter at different heights come back at different angles, but they pile up near one angle, where the returning angle is greatest. René Descartes worked this out in 1637. That pile-up is the rainbow: about 42° from the antisolar point, the point in the sky directly opposite the Sun (where the shadow of your head falls). Because violet bends more, its pile-up is at a smaller angle, so red sits on the outside of the bow:
Light that reflects twice inside the drop makes a fainter second bow at about 51° (50.5° for red, 53.4° for violet), with its colors in reverse order. Hardly any light comes back at angles between the two bows, so the sky between them looks darker. It is called Alexander's dark band. The simulation's graph shows all of this, computed from the index of water at 20 °C. In the real sky the Sun is half a degree wide, which blurs the bands a little.
Try this
A common mix-up
"A rainbow is an arch standing somewhere in the sky, and you could walk to its end." It isn't a thing in a place. A rainbow is a set of directions: every drop that sits 42° from the point opposite the Sun sends red light toward your eye, and those drops can be near or far. Someone standing next to you gets their light from different drops, so they see their own rainbow, centered on the shadow of their own head. As you walk, it moves with you, which is why nobody ever reaches the end.
A second one: "The prism adds color to white light." Isaac Newton showed the opposite. The colors are already in white light; the prism only sends them in slightly different directions. He sent one color through a second prism and it stayed the same color, and he recombined the spread-out colors back into white.
How the simulation works
Rays. Each ray is a straight line until it meets a surface. The program finds the nearest surface it hits (flat faces, or circular arcs for lenses, curved mirrors and the drop) and works out what happens there: a mirror reflects 95% of the light; at glass, Snell's law gives the new direction, the Fresnel equations give the fraction reflected, and the reflected part becomes a new, weaker ray that is followed too, until it carries less than 0.15% of the starting light. Past the critical angle, all of the light reflects.
Real lenses. A lens is two circular faces with a blackened rim, and each face bends the light by Snell's law, so spherical aberration and color fringes appear on their own. The Ideal thin lens setting replaces the glass with the textbook rule (a ray's slope changes by its height divided by f), which focuses perfectly. Its f is the lensmaker's value for yellow light.
Colors and glass. The index of each glass comes from the Sellmeier formula with SCHOTT's coefficients for N-BK7 and N-SF11. Water uses the IAPWS formula for 20 °C. That formula gives the index compared with a vacuum, while glass catalogs compare with air, so it is divided by the index of air, 1.00027. The raindrop graph uses Descartes's exact path through a round drop for 1,800 rays at each of the nine colors.
What's simplified. The bench is flat: it shows one slice through each piece, which for the drop gives the same angles as a round drop. Light is treated as rays, so there's no diffraction or interference. The glass doesn't absorb, air has an index of exactly 1, and the drop is drawn about a hundred times too big. Because the bench is flat, the two polarizations of light can be followed separately, and they are.
How it was checked
| Test | Result | Expected |
|---|---|---|
| BK7 index at 587.6 / 486.1 / 656.3 / 404.7 nm | 1.51680 / 1.52238 / 1.51432 / 1.53024 | SCHOTT data sheet, same to 5 decimals |
| SF11 index at the same lines | 1.78472 / 1.80651 / 1.77596 / 1.84235 | SCHOTT data sheet, same to 5 decimals |
| Water formula, 0 °C, at 226.5 / 589 / 1014 nm | 1.394527 / 1.334344 / 1.326135 | IAPWS check values, all equal |
| Water at 20 °C, 589.3 nm, relative to air | 1.33299 | 1.3330 (CRC Handbook) |
| Snell's law at a block, 40° in | 25.0745°, exits at exactly 40° | 25.0745° |
| Sideways shift through a 12 cm block | 3.412353 cm | t sin(θ1 − θ2) / cos θ2 = 3.412353 cm |
| Critical angle, BK7: ray at 41.237° and 41.257° | leaves (89% reflected) / totally reflected | θc = 41.247° |
| Fresnel: reflected + transmitted, 1° to 89° | 1 within 4 × 10−16 | 1 |
| All light out of a lens and a drop, every branch | 1.000000 | 1 (nothing lost) |
| Convex lens, R = 20 cm: f from a ray near the axis | 19.5953 cm | lensmaker's (thick) 19.5953 cm |
| Concave lens, R = 20 cm | −19.2842 cm | −19.2842 cm |
| Ideal lens images a point: spread of rays at di | 4 × 10−15 cm | 0 |
| Concave mirror, R = 40 cm: focus | 20.0000 cm | R/2 = 20 cm |
| Prism: index from the traced minimum deviation (BK7, SF11) | 1.516740, 1.784501 | 1.516740, 1.784501 |
| Drop: traced rays vs Descartes's formula, 15 rays | largest gap 2 × 10−12° | 0 |
| Primary and secondary bow at 589 nm: search over all rays | 42.078°, 50.891° | formula: 42.078°, 50.891° |
Sources
- OpenStax, University Physics Volume 3: 1.3 Refraction, 1.4 Total Internal Reflection, 1.5 Dispersion, 2.2 Spherical Mirrors and 2.4 Thin Lenses.
- SCHOTT optical glass data sheets: N-BK7 and N-SF11 (Sellmeier coefficients and measured indices); Wikipedia, Sellmeier equation.
- International Association for the Properties of Water and Steam, Release on the Refractive Index of Ordinary Water Substance (IAPWS R9-97); Wikipedia, Optical properties of water and ice.
- NIST, speed of light in vacuum (299,792,458 m/s, exact).
- E. Hecht, Optics, 5th ed. (Pearson, 2017): Fresnel equations, thick lenses and the rainbow.
- D. R. Lide (ed.), CRC Handbook of Chemistry and Physics: refractive index of water.
- Wikipedia, Fresnel equations and Rainbow.