Loading tool…
Loading interactive tool…

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.

Core equations

n₁ sin(θ₁) = n₂ sin(θ₂)1/f = (n − 1)(1/R₁ − 1/R₂)surface sag: s = R − sign(R)√(R² − y²)

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

  • 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.

References and verification

  • 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.