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.

Lenses

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):

    angle of incidence = angle of reflection

    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:

    n1 sin θ1 = n2 sin θ2

    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

    R = ((n − 1) / (n + 1))²

    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:

    sin θc = n2 / n1

    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:

    1/f = (n − 1) [ 1/R1 − 1/R2 + (n − 1) d / (n R1 R2) ]

    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:

    1/f = 1/do + 1/di      m = −di / do

    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:

    n² = 1 + B1λ²/(λ² − C1) + B2λ²/(λ² − C2) + B3λ²/(λ² − C3)
    Materialviolet 404.7 nmyellow 587.6 nmred 656.3 nmcritical angle
    BK7 crown glass1.53021.51681.514341.2°
    SF11 dense flint glass1.84241.78471.776034.1°
    Water, 20 °C1.34281.33301.331248.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.

    n = sin((A + D) / 2) / sin(A / 2)     (A = the prism's apex angle)

    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:

    rainbow ray: cos² i = (n² − 1) / (k(k + 2))     k = 1 reflection: red (650 nm) 42.3°, violet (405 nm) 40.7°

    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

    Check Snell's law. In Glass block, turn the laser so it hits the top face at 30°. Read θ1 and θ2 off the labels and check that 1.000 × sin 30° = 1.517 × sin θ2. Change the laser to violet: it bends a little more.
    Find the critical angle. In Glass block, drag the laser into the middle of the block, as if the light started inside the glass, and turn it slowly. The beam gets out through the top while it meets the surface at less than 41.2°, bending away from the normal, and the reflected part grows brighter. Past 41.2°, nothing gets out: all of it reflects. Then, in Light pipe, aim the laser at the rod's side instead of its end. Can light that comes in through a side ever be trapped?
    Real lens or perfect lens? In Focus sunlight, move the screen until the spot is smallest and note the distance. Switch to Ideal thin lens: the rays now meet at one point, a little farther away. Make the sunlight beam wider and watch the edge rays of the real lens drift toward the lens.
    Image distances. In Make an image, bring the lamp closer to the lens and find the sharp image again: it moves farther away. Bring the lamp inside the focal length (closer than 14.8 cm) and the rays never meet: that's a magnifying glass, which makes a virtual image you can only see by looking through the lens.
    Two glasses. In Prism, switch the prism from SF11 flint to BK7 crown glass. The beam bends less and the spectrum gets much narrower (move the screen to catch it). Dense flint glass spreads colors more, which is why it's chosen for prisms; the lead crystal in chandeliers flashes colors for the same reason.
    A glass bow. In Raindrop, select the drop and change it to BK7 glass. A glass bead bends light more than water does, and its bow moves in to about 21°. Move the eye to find it.
    Stay safe with light. Never look at the Sun, and never look at it through a lens, binoculars or a camera. Never point a laser at anyone's eyes, at an animal, or at an aircraft. Don't use a magnifying glass to focus sunlight: the spot can burn skin and set paper, leaves or wood on fire.
    At home, safely: stand a pencil in a clear glass of water and look from the side: it seems broken at the surface. Put a coin in an empty mug, move back until the rim just hides it, and have someone slowly pour in water: the coin comes into view as the light bends at the water's surface. On a sunny day, stand with your back to the Sun and spray a fine mist from a garden hose in front of you: a rainbow appears around the shadow of your head, about 42° out.

    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

    TestResultExpected
    BK7 index at 587.6 / 486.1 / 656.3 / 404.7 nm1.51680 / 1.52238 / 1.51432 / 1.53024SCHOTT data sheet, same to 5 decimals
    SF11 index at the same lines1.78472 / 1.80651 / 1.77596 / 1.84235SCHOTT data sheet, same to 5 decimals
    Water formula, 0 °C, at 226.5 / 589 / 1014 nm1.394527 / 1.334344 / 1.326135IAPWS check values, all equal
    Water at 20 °C, 589.3 nm, relative to air1.332991.3330 (CRC Handbook)
    Snell's law at a block, 40° in25.0745°, exits at exactly 40°25.0745°
    Sideways shift through a 12 cm block3.412353 cmt 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−161
    All light out of a lens and a drop, every branch1.0000001 (nothing lost)
    Convex lens, R = 20 cm: f from a ray near the axis19.5953 cmlensmaker'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 di4 × 10−15 cm0
    Concave mirror, R = 40 cm: focus20.0000 cmR/2 = 20 cm
    Prism: index from the traced minimum deviation (BK7, SF11)1.516740, 1.7845011.516740, 1.784501
    Drop: traced rays vs Descartes's formula, 15 rayslargest gap 2 × 10−12°0
    Primary and secondary bow at 589 nm: search over all rays42.078°, 50.891°formula: 42.078°, 50.891°

    Sources

    @teddyrookbook GitHub