Loading…

Ray Tracing Simulator

Physics Optics • Geometric Optics Basics

View all topics

Trace multiple rays through a sequence of mirrors and thin lenses, animate the resulting paths, and inspect repeated reflections and refractions in an optical-bench style scene.

Source and ray bundle
Element sequence
Supported lines:
mirror x1=18 y1=-2 x2=22 y2=2
lens x=35 f=18 a=8
Lens rule uses the paraxial thin-lens update \(u' = u - y/f\), where \(u = dy/dx\). Mirror reflection uses \(\mathbf{r}=\mathbf{d}-2(\mathbf{d}\cdot\mathbf{n})\mathbf{n}\).
Animation
Ready
Ready
Animated ray tracing diagram
Each ray is traced until it leaves the scene or reaches the interaction limit. Mirrors reflect, and lenses refract using the paraxial thin-lens slope update.
Drag to pan. Use the mouse wheel to zoom. Fit view restores the default framing.
Enter values and click “Calculate”.

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

How are mirrors handled in this simulator?

Mirrors are treated as finite plane segments. When a ray hits a mirror, the outgoing direction is computed with the vector reflection law r = d - 2(d·n)n.

How are lenses handled in this simulator?

Lenses are modeled as thin paraxial elements. At the hit height y, the incoming slope u = dy/dx is updated by u' = u - y/f, where f is the signed focal length.

Why does the simulator need a maximum interaction limit?

Some scenes can trap rays in repeated reflections. The interaction limit prevents infinite loops and keeps the tracing stable.

What is the benefit of tracing several rays instead of one?

A ray bundle reveals how the full beam behaves, including alignment, clipping, and whether the system transports or redirects light cleanly.