Browser-local interactive workspace
Interactive workspace initializes in your browser. Engineering method, assumptions, validation, and references are available below.

Engineering reference

Lens Ray Simulator: theory, method, and sources

This optics & photonics workspace publishes 3 governing equations, 4 stated assumptions, 3 documented boundaries, and 1 source so the numbers it returns can be checked rather than taken on trust.

Calculations run locallyCalculation & source methodology

How this tool works

The simulator models each lens as two spherical or planar refracting surfaces. Rays are intersected with each surface and refracted using the vector form of Snell’s law.

Use presets as starting points, then change lens type, position, curvature, aperture, refractive index, and orientation. The lensmaker estimate is shown for comparison with the traced rays.

Calculators and topics covered

  • ray tracing
  • lenses
  • refraction
  • optical materials
  • focal length
  • Snell law
  • lensmaker equation
  • biconvex
  • biconcave
  • plano convex
  • beam expander
  • ray diagram

Core equations

n1  sin(θ1)=n2  sin(θ2)n_{1}\; \sin \left(\theta _{1}\right) = n_{2}\; \sin \left(\theta _{2}\right)1f=(n1)(1R11R2)\frac{1}{f} = \left(n - 1\right) \left(\frac{1}{R_{1}} \frac{- 1}{R_{2}}\right)surface sag:s=Rsign(R)R2y2\text{surface sag:}\quad s = R - \text{sign} \left(R\right) \sqrt{R^{2} - y^{2}}

Method and assumptions

Assumptions

  • The surrounding medium is air with refractive index n = 1.
  • Lens materials are homogeneous and isotropic.
  • Surfaces are spherical or planar and centered on one optical axis.
  • The displayed focal length uses the thin-lens lensmaker equation even though rays are traced through finite-thickness geometry.

Limitations and design boundaries

  • Dispersion is not yet wavelength-dependent; each lens uses one scalar refractive index.
  • Reflection losses, coatings, absorption, diffraction, polarization, and aspheric surfaces are not modeled.
  • This is an educational simulator and is not a substitute for validated optical-design software.

Sources and references

Primary sources are preferred for ratings, standards, manufacturer data, and externally defined constants.

Source policy
  • Source implementation supplied for the first platform draftThe original single-file simulator was reorganized into a platform tool module while retaining its lens types, presets, material values, and ray-tracing model.