Skip to main content
Sandbox Physics

Optics 007 · Ray worlds, boundaries, and natural optics

Fermat Path Finder

A cinematic variational theatre keeps source and detector fixed while a draggable trial path moves across an opaque mirror, a two-index interface, or a continuous parabolic GRIN field. The physical ray, candidate variation, optical-path landscape, and governing-law residual all come from one model.

Interactive modelFermat Path Finder
Candidate arrival-time shift Δt\Delta t0.500.50
First variation δOPL/δa\left|\delta\mathrm{OPL}/\delta a\right|50%50\%
Physical-law residual εlaw\varepsilon_{\mathrm{law}}0.00π0.00\pi
Model regimevalid model regime\text{valid model regime}

Physics tutorial

Audit the physics of Fermat Path Finder

BackgroundFermat optics compares neighboring curves with the same endpoints. The physical ray makes the optical-path functional stationary: δOPL=δ ⁣ABn(r)ds=0\delta\mathrm{OPL}=\delta\!\int_A^B n(\mathbf r)\,\mathrm ds=0. “Stationary” is the precise statement: the direct branches selected in this lab are local minima, while other optical systems can have stationary maxima or saddle paths. The principle is not a universal shortest-geometric-distance rule.

Why it mattersWhy does a stationary travel-time path reproduce reflection, refraction, and curved rays?

Start with the essentials

Focus question
Why does a stationary travel-time path reproduce reflection, refraction, and curved rays?
One-sentence intuition
The magenta family uses one fixed-endpoint variation parameter. At the gold path, OPL(a)aa=0=0\left.\frac{\partial\mathrm{OPL}(a)}{\partial a}\right|_{a=0}=0. The floating landscape, signed arrival-time shift, and derivative therefore identify the same stationary curve instead of three unrelated animations.

Core mathematical model

Fixed-endpoint optical path

OPL[r]=ABn(r)ds,δOPL=0\mathrm{OPL}[\mathbf r]=\int_A^B n(\mathbf r)\,\mathrm ds,\qquad \delta\mathrm{OPL}=0

The comparison curves must retain both endpoints. A shorter unrelated route to a different detector says nothing about Fermat stationarity.

Boundary transversality

n1sinθ1=n2sinθ2n_1\sin\theta_1=n_2\sin\theta_2

Stationarity with respect to the boundary hit preserves tangential optical momentum. Equal indices on a reflector reduce the condition to equal incidence and reflection angles.

Continuous-index ray equation

dds ⁣(ndrds)=n\frac{\mathrm d}{\mathrm ds}\!\left(n\frac{\mathrm d\mathbf r}{\mathrm ds}\right)=\nabla n

The GRIN path is integrated from this equation and solved as a boundary-value problem. The numerical check separately monitors the conserved axial optical momentum.

Common difficulties

Replacing stationary optical path with shortest distance

Typical misconceptionLight simply chooses the geometrically shortest line, so refractive index and neighboring paths are secondary details.

Better mental modelThe functional weights every segment by its local refractive index. Reflection, refraction, and smooth bending all follow from stationarity of that weighted path with fixed endpoints.

Run the experiment

  1. 01

    Scene 1: Mirror equal-angle stationarity

    In the mirror scene, drag the magenta surface point until it coincides with the gold hit; compare the two mirror angles and locate the stationary point of the arrival-time landscape.

    What to observe: Only the gold mirror path turns at the equal-angle hit. The dashed comparison is not reflected light and carries no photon pulses.
  2. 02

    Scene 2: Snell interface stationarity

    Switch to the two-medium scene, move the target, and verify that the stationary crossing shifts while the source and target remain fixed during each variation sweep.

    What to observe: The interface stationary crossing is generally displaced from the straight geometric crossing because the slower medium changes the optical-path weighting.
  3. 03

    Scene 3: GRIN curved geodesic

    Enter the GRIN scene, orbit the camera through the index contours, then return the trial deformation to zero while watching the first variation and momentum residual.

    What to observe: The GRIN solution bends continuously toward larger index. Neighboring physical launch rays end elsewhere, whereas every magenta variation retains the chosen target.