Virtual optical bench
Place an object and lenses, move them with the mouse: rays, images and calculations (lens equation, magnification) update in real time. For high school and university physics. The “Exact ray tracing” mode applies Snell's law (thick lenses, refracting surfaces, mirrors, prisms) and shows aberrations and dispersion.
Drag a lens, the object (or its tip B to change its height), the screen. Wheel: zoom; drag the background: pan. Selected element: arrow keys (Shift: 1 cm steps), Delete. Ctrl+Z / Ctrl+Y: undo / redo.
Exact ray tracing: every ray follows Snell's law at each surface. Drag the elements; the “Flip” button in the table turns a lens round.
Elements
Calculations
Practise: interactive exercise
Focal length measurement: simulated lab
Exercise sheets
How to use the optical bench
- Build the set-up: add an object, one or more lenses, a screen, a stop, or start from a ready-made set-up (magnifying glass, telescope, eye…).
- Move elements with the mouse or a finger, or type exact values in the element table (focal length or power, diameter, position).
- Read the calculations: for each lens, the lens equation with numbers, the magnification, the size and nature of the image (and Newton's relation if ticked).
- Export the diagram and calculations as PDF, SVG or LaTeX (editable TikZ figure), or share the set-up with a link.
Instruments, labs and exercises
- Instruments: pick a magnifying glass, an astronomical telescope, a microscope, an eye (normal, short-sighted, long-sighted, presbyopic, with or without correction) or a camera. The bench sets itself up and the instrument's own calculations are added: magnification, eye ring, near and far points, power of the corrective lens, depth of field.
- Focal length measurement: measure the focal length of a “mystery lens” with Bessel's, Silbermann's, autocollimation, Badal's method or the lens equation. Measurements are simulated with a realistic focusing latitude. High-school level: mean, standard deviation, standard uncertainty s/√n, z-score. University level: type A and B uncertainties, propagation, Monte Carlo, linear regression. The report exports to LaTeX and the data to CSV.
- Interactive exercise: a set-up appears without rays or image; work out the position and size of the image, place B' with a click, ask for a hint or the solution.
Conventions
Light travels from left to right. Distances are signed, positive in the direction of light (and upwards for heights), in centimetres. For a lens with optical centre $O$ and image focal length $f'$ (positive for a converging lens, negative for a diverging one):
$$\frac{1}{\overline{OA'}} - \frac{1}{\overline{OA}} = \frac{1}{f'} \qquad \gamma = \frac{\overline{A'B'}}{\overline{AB}} = \frac{\overline{OA'}}{\overline{OA}} \qquad V = \frac{1}{f'}$$
With several lenses, points are numbered ($O_1$, $F'_1$…) and the image formed by one lens is the object of the next one, possibly virtual. Rays are drawn in the paraxial approximation (thin lens model). A dashed ray is an extension and carries no light.
Frequently asked questions
Do the exercise sheets come with answers?
Yes: each sheet (data, questions, scale diagram on a grid to complete) has an answer key with the construction and every calculation. Values are random for each new exercise.
What does the “Exact ray tracing” mode show?
It drops the paraxial approximation: every ray is refracted with Snell's law $n_1 \sin i_1 = n_2 \sin i_2$ (or reflected) at each real surface. Thick lenses (radii of curvature, thickness, index), spherical or plane refracting surfaces and spherical or plane mirrors are available. The calculations give the thick lens power and principal planes, the paraxial and marginal images, longitudinal and transverse spherical aberration, the circle of least confusion and the gap with the thin lens model, which can be overlaid on the diagram. Try the plano-convex lens both ways round: aberration is about four times larger with the flat side towards the light.
Prism, dispersion and chromatic aberration
The prism (apex angle, height, rotation) gives the angles $i$, $r$, $r'$, $i'$, the deviation $D = i + i' - A$, the minimum deviation $D_m = 2\arcsin\left(n\sin\frac{A}{2}\right) - A$ (a button rotates the prism to reach it), the emergence condition and the $D(i)$ curve. Glasses (BK7 crown, F2 and SF11 flints, water) follow Cauchy's law $n = A + B/\lambda^2$: in white light the prism splits light up; with a lens, the blue and red foci separate (chromatic aberration), and the crown + flint achromatic doublet corrects it.
Are my set-ups sent anywhere?
No. Everything is computed in your browser; the share link contains the set-up itself.