# Ray Diagram Simulator - Lenses, Mirrors & Two-Lens Systems

> Interactive ray diagrams for converging and diverging lenses and concave and convex mirrors: drag the object to see image position, size and magnification.

- URL: https://qilingtools.com/en/math/optics
- Category: Physics Tools (https://qilingtools.com/en/physics)
- Tags: [Physics](https://qilingtools.com/en/tags/physics), [Education](https://qilingtools.com/en/tags/education)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

Put a converging lens, diverging lens, concave mirror or convex mirror on an optical bench and drag the object arrow or the focal points: the parallel ray, chief ray and focal ray redraw instantly, with solid lines for real rays and dashed extensions for virtual ones. Below the diagram, the thin-lens and mirror equations 1/f = 1/dₒ + 1/dᵢ and m = −dᵢ/dₒ are written out with your numbers, using the real-is-positive sign convention. Two-lens mode feeds the first lens's image to the second as its object, giving the intermediate image, final image and total magnification of a compound microscope or a Keplerian or Galilean telescope.

## How to use

1. Pick a preset (camera, projector, magnifier, car mirror…) or choose the type of lens or mirror
2. Drag the blue object arrow to change distance and height, drag a focal point F to change the focal length, or type values
3. Read the image distance, magnification and image type next to the three principal rays
4. Switch to the two-lens system and try the microscope or telescope presets

## Features

- Converging and diverging lenses, concave and convex mirrors
- Three principal rays with dashed extensions for virtual images
- Drag the object or focal points; animate the object moving in
- Image distance, magnification, image height, power and radius of curvature
- Two-lens systems: intermediate image, virtual objects, total magnification, effective focal length
- Step-by-step equations with a clearly stated sign convention

## FAQ

### Where does a converging lens form its image?

It depends on where the object sits relative to the focal length f. Beyond 2f: a real, inverted, smaller image (a camera). At 2f: real, inverted and the same size. Between f and 2f: real, inverted and enlarged (a projector). Exactly at f: no image, the rays leave parallel. Inside f: a virtual, upright, enlarged image on the same side as the object (a magnifying glass). Press “Move object” to watch the image run off to infinity as the object approaches F and then flip to the near side as a virtual image.

### What sign convention does the tool use?

The real-is-positive convention common in school and introductory physics: the object distance dₒ is positive for a real object; the image distance dᵢ is positive for a real image (beyond a lens, or in front of a mirror) and negative for a virtual one; f is positive for converging lenses and concave mirrors and negative for diverging lenses and convex mirrors. Magnification m = −dᵢ/dₒ, so a negative m means inverted. Textbooks using the Cartesian convention write 1/v − 1/u = 1/f instead; the physics is the same.

### Why do diverging lenses and convex mirrors always give smaller, upright images?

Their focal length is negative, so in 1/dᵢ = 1/f − 1/dₒ both terms on the right are negative. That makes dᵢ negative (a virtual image) and smaller in size than both |f| and dₒ, so |m| = |dᵢ|/dₒ is always below 1. The image sits inside the focal length, upright and reduced. That’s why passenger-side car mirrors are convex: things look smaller, but you see a wider field — hence “objects in mirror are closer than they appear”.

### How is the magnification of a microscope or telescope worked out?

The lenses image one after the other. The objective forms an intermediate image I₁, which becomes the object for the eyepiece at dₒ₂ = d − dᵢ₁ (negative if I₁ would land beyond the eyepiece — a virtual object). The total lateral magnification is M = m₁·m₂. In a microscope the objective makes a magnified real image and the eyepiece acts as a magnifier, giving tens to hundreds of times. For telescopes, which look at distant objects, the useful figure is the angular magnification −f₁/f₂; a Keplerian telescope gives an inverted view, a Galilean one (diverging eyepiece) an upright view.

### Why do all rays bend at the centre line of the lens?

That’s the thin-lens, paraxial approximation: the lens thickness and surface curvature are ignored, each ray bends once at the lens plane, and only rays at small angles to the axis are considered. Within it the lens equation is exact and every ray from an object point meets at one image point. Real lenses have thickness, spherical and chromatic aberration, so steep rays don’t focus perfectly. The diagram also stretches the vertical scale so rays are easier to see, which makes them look steeper than they really are.

## Related tools

- [Unit Converter](https://qilingtools.com/en/math/unit): Free online unit converter: length, area, volume, weight, temperature, time, speed, data, pressure, energy and angle — one value converts every unit at once.
- [Vector Calculator](https://qilingtools.com/en/math/vector): Free online vector calculator for 2D and 3D: addition, scalar multiples, dot and cross products, magnitude, angle, unit vector and projections, with checks.
- [Significant Figures Calculator](https://qilingtools.com/en/math/significant-figures): Free online sig fig calculator: count significant figures digit by digit, round to N sig figs or decimals with six rounding modes, and compute by sig fig rules.
- [Tone Generator](https://qilingtools.com/en/audio/tone-generator): Free online tone generator: sine, square, sawtooth and triangle waves from 1 to 20,000 Hz, a note picker, sweeps, white/pink/brown noise and a WAV download.
- [Audio Spectrogram](https://qilingtools.com/en/audio/spectrogram): Free online spectrogram generator: see time, frequency and level from a Hann-windowed STFT, with FFT size, log axis, dB range and colour maps. Exports PNG.
- [Decibel Meter](https://qilingtools.com/en/audio/decibel): Free online decibel meter: measure noise with your mic in real time, A/C/Z weighting, fast/slow response, min/max/average/Leq, 60-second graph and calibration.
- [Physics Formula Calculator](https://qilingtools.com/en/math/physics): Physics formulas solved with steps: SUVAT, projectiles, Newton’s laws, inclines, energy, Ohm’s law, resistors, RC, buoyancy, waves, lenses, gravity.
- [Fourier Series & FFT Visualizer](https://qilingtools.com/en/math/fourier): Fourier series coefficients and animated partial sums for square, sawtooth, triangle or any function (Gibbs), draw-your-own epicycles and FFT spectra.
