Skip to content
Light & Optics · Physics

Fermat's Principle of Least Time: 3D Simulation

Light takes the path of least time. Race beads from A to B along many paths at once — off a mirror, across a boundary into glass, and through a lens — and drag the crossing point to find the quickest. The law of reflection, Snell's law and why a lens focuses all fall out of one rule.

Interactive virtual lab · no download · works on phones and laptops

Chapter
Ray Optics
For
Class 10–12 · JEE
Time
~20 min

Fermat's Principle of Least Time is a Pro simulation

Pro opens all 152 virtual labs — 693 simulations with guides and quizzes.

How to use it

  1. 1Pick a module from the list (3); set your level at the top right for more controls.
  2. 2Drag the orange knob to move where the light crosses; watch the beads race and the time graph.
  3. 3Use Predict before you look, then Derive, Questions, Practise and Compare.

What to notice

  • Off a mirror the quickest path is the shortest, and it has i = r.
  • Into a slower medium the quickest path bends towards the normal: n₁ sin i = n₂ sin r.
  • Through a lens every path from object to image takes the same time — that is why they meet.

For teachers

A ready-made teaching kit comes with this lab

  • Lesson plan

    25 min, 4 steps

  • Ask the class

    4 questions with answers

  • Quick quiz

    6 questions, printable

  • Key formulas

    4 formulas

About the Fermat's Principle of Least Time simulation

Fermat's principle says light travels between two points along the path that takes the least time. This Fermat's principle simulation makes that visible: beads leave a lamp along a whole fan of paths at the same instant, each moving at the speed of light in its medium, and race to the target. The green bead always wins, and you can drag the crossing point to put your own orange path onto the winner's.

Off a mirror the quickest path is simply the shortest, and it has equal angles — the law of reflection, found with the image method. Into glass, where light is slower, the straight line is no longer quickest: the winner bends towards the normal so it spends less distance in the slow medium, which is Snell's law n₁ sin i = n₂ sin r (the lifeguard problem). The third module explains why a lens focuses: rays through the edge travel further in air, the central ray goes through more glass, and only at the image do all their times match — the lens formula is Fermat's principle in disguise.

Also covers: fermat's principle, principle of least time, least time path, law of reflection proof, snell's law derivation, lifeguard problem, optical path length, image method reflection, lens equal optical path, why light refracts, class 12 ray optics, jee optics.

Frequently asked questions

What is Fermat's principle of least time?

Light going from one point to another follows the path for which the travel time is least (strictly, stationary). In one medium that is the shortest path; across a boundary between media of different speeds it is a bent path that obeys Snell's law.

How do you derive Snell's law from Fermat's principle?

Write the time to go from A in medium 1 to B in medium 2 through a point x on the boundary: t = [n₁√(x² + a²) + n₂√((d − x)² + b²)]/c. Setting dt/dx = 0 gives n₁ x/AP = n₂ (d − x)/PB, which is n₁ sin i = n₂ sin r.

What is the lifeguard problem?

A lifeguard who runs faster than she swims wants to reach a swimmer as quickly as possible. She should not run straight at the swimmer; she should run further along the beach and swim less, entering the water where the speeds satisfy sin i/v₁ = sin r/v₂ — exactly the rule light follows.

Why does a lens bring all rays to one image point?

A converging lens is thickest at the centre. The central ray has the shortest path through air but goes through the most glass, where light is slow; edge rays go further through air and less glass. The lens's shape makes these times equal at the image, so the waves arrive in step and add up there.