Home▸Optics & Light▸Laser Labyrinth — Reflection & Refraction (2D)

Laser Labyrinth — Reflection & Refraction (2D)

2D laser-maze lab: a plain-canvas ray tracer bounces a beam off draggable mirrors and bends it through glass blocks via Snell's law, with a live critical-angle readout, TIR counter and five puzzle levels plus a free-build mode.

Optics & Light2DEasy60 FPS📱 Mobile-adapted⇄ 3D version
2d-laser-labyrinth ↗ Open standalone

This 2D companion runs the same laser-maze ray tracer as the 3D version — exact reflection off mirrors (θᵢ = θᵣ) and Snell's-law refraction through glass (n₁·sin θ₁ = n₂·sin θ₂), five fixed puzzle levels plus a free-build mode — but drawn with a plain 2D canvas context instead of a WebGL scene, and it adds two readouts the 3D version doesn't show: a live total-internal-reflection counter, separate from ordinary mirror bounces, and a critical-angle θc display that recomputes as you move the glass IOR slider, so you can predict TIR before the beam hits the glass rather than only see it afterward.

⚙ Under the hood

2D laser-maze lab with a plain-canvas ray tracer, exact reflection and Snell's-law refraction, a live critical-angle readout, a total-internal-reflection counter, five puzzle levels and a free-build mode.

ray tracingreflectionrefractionsnell's lawcritical angletotal internal reflection

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)