Skip to main content
Preparing workspace

Lens & Mirror Simulator

Pick a convex or concave lens or mirror, drag object distance and focal length, and read the ray diagram, image distance v, magnification and image type.

Still loading. If the tool doesn’t appear, reload this page.

About this tool

Lens & Mirror Simulator

Interactive geometric optics ray diagram generator for convex/concave lenses and spherical mirrors with real-time magnification and image tracking.

This lens and mirror simulator shows where an image forms and what it looks like. Choose a convex or concave lens or mirror, set object distance u and focal length f, and it solves for the image distance v, magnification, and whether the image is real or virtual, inverted or upright.

How to use Lens & Mirror Simulator

  1. Under "Optical Element Setup" pick the optic — Convex Lens, Concave Lens, Concave Mirror or Convex Mirror.

  2. Drag the three sliders — Object Distance (u) from 30 to 300 mm, Focal Length (f) from 30 to 150 mm and Object Height (h_o) from 20 to 100 mm — and the canvas redraws the axis, F and 2F points and the two rays: one parallel to the axis through the focus, one through the optical centre or pole.

  3. Read "Image Character & Metrics" for Image Distance (v) in mm, Magnification (m), Real Image or Virtual Image and Inverted or Upright, solved from 1/f = 1/v - 1/u for lenses and 1/f = 1/v + 1/u for mirrors; Reset returns the convex lens at u = 150 mm, f = 80 mm.

Why use Lens & Mirror Simulator

  • Formula and diagram stay in sync

    The ray construction is drawn from the same solved value of v that is displayed, so the picture and the number never disagree.

  • Sign convention applied for you

    Object distance is taken as negative (object to the left), focal length positive for a convex lens and convex mirror and negative for a concave lens and concave mirror, whose focus lies on the object side — the step most textbook errors come from.

  • Every case reachable by sliding

    The four optic types and the full range of object distances cover all the standard image cases without needing a separate diagram for each.

Common use cases

  • You are working through a Class 10 or Class 12 optics chapter and want to see why an object placed inside the focal length of a convex lens suddenly gives a virtual, magnified, erect image instead of a real one.
  • You are teaching the topic and need to show the moment an image flips — sliding the object from beyond 2F towards F while the class watches the magnification cross −1 and then blow up.
  • You are checking a homework answer and want to confirm the sign of v and m before trusting your own arithmetic on the mirror formula.

Frequently asked questions

What is the lens formula and how does it differ from the mirror formula?

The thin lens formula is 1/f = 1/v − 1/u and the mirror formula is 1/f = 1/v + 1/u, with u the object distance, v the image distance and f the focal length. The sign difference follows from light passing through a lens but reflecting back from a mirror, which is also why magnification is m = v/u for a lens and m = −v/u for a mirror.

Link to answer
When does a convex lens form a virtual image?

When the object is closer to the lens than one focal length. Inside F the rays diverge after refraction and never actually meet, so the image is virtual, erect and magnified — this is the magnifying-glass case. At exactly F no image forms, and beyond F the image is real and inverted.

Link to answer
What does a negative magnification mean?

That the image is inverted relative to the object. A magnitude greater than 1 means it is enlarged and less than 1 means it is diminished, so m = −2 is an inverted image twice the object's height and m = −0.5 an inverted image half its height. Positive magnification always corresponds to an erect, virtual image.

Link to answer
Why does a convex mirror always give the same kind of image?

Because its focus lies behind the mirror (f is positive in the Cartesian convention used here), the mirror formula gives a positive v for any real object — the image is always virtual, erect and smaller than the object, and always sits between the pole and the focus. That constant wide field of view is why convex mirrors are used as vehicle wing mirrors and blind-corner mirrors.

Link to answer
Does a concave mirror form a real or a virtual image?

Both, depending on where the object is. Beyond the focus a concave mirror forms a real, inverted image in front of the mirror; inside the focus it forms a virtual, upright, magnified image behind it (the shaving-mirror case). With the object exactly at F the reflected rays are parallel and no image forms — the simulator shows the image distance as infinity.

Link to answer
What sign convention does the simulator use?

The Cartesian (New Cartesian) convention: distances are measured from the optical centre or pole, the object sits on the left so u is negative, and distances in the direction of the incoming light are positive. A convex lens and a convex mirror get a positive f; a concave lens and a concave mirror get a negative f.

Link to answer
What else should I know about this tool?

It draws a live principal-ray diagram and uses the standard formulas — 1/f = 1/v − 1/u for lenses and 1/f = 1/v + 1/u for mirrors — under the Cartesian sign convention. Drag the object distance (30–300 mm), focal length (30–150 mm) and object height (20–100 mm) and the two construction rays redraw, one parallel to the axis and refracted or reflected through the focus, the other straight through the optical centre or pole. Magnification is given as m = v/u, and the image height is shown alongside the diagram.

Link to answer