GenerateRandomSearch

Thin Lens Calculator

One equation governs every simple lens, and the interesting part is how much behaviour falls out of it. Move an object inside a converging lens's focal length and the image flips from real and inverted to virtual and upright — the same equation, a different sign. A diverging lens, meanwhile, can only ever do one thing. This generates lens problems and works all of that out, checking each answer against the equation it came from.

What this generator does

Generates a lens and an object position, solves the thin-lens equation for the image distance, and derives the magnification from the two distances. It then states whether the image is real or virtual and upright or inverted, each of which follows from the sign of one of those numbers.

How to use this tool

  1. Generate a problem and read the focal length and object distance.
  2. Work out the image distance yourself from 1/f = 1/u + 1/v.
  3. Check whether the image is real or virtual, upright or inverted.
  4. Generate several — a diverging lens always behaves the same way, a converging one does not.

Understanding the controls

Generate
Produces a converging or diverging lens with a focal length between 5 and 40 cm and an object placed somewhere sensible — never right at the focal point, where the image runs off to infinity.
Seed
Any word reproduces exactly the same lens and object position.

Common use cases

  • Optics practice with answers that verify themselves
  • Generating lens problems for a lesson or a problem set
  • Understanding when a magnifying glass magnifies and when it does not
  • Checking a ray-diagram result numerically
  • Setting the same problem twice from a seed

How this generator works

The check has three parts that could each fail independently. The lens equation must balance with the computed image distance substituted in. The magnification must agree with the ratio of the two distances, computed separately. And a diverging lens must produce a virtual, upright, diminished image — always, with no exceptions — which is a strong statement that catches a sign error immediately.

Randomness and fairness

The lens type, focal length and object distance are random; the image and magnification are then deterministic. A seed reproduces the same problem exactly and is therefore explicitly not cryptographically secure. Without a seed the browser's cryptographically secure generator is used.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • Thin lenses only: the lens is treated as having no thickness, which is the standard simplification.
  • A single lens, so multi-element systems and lens combinations are not covered.
  • No aberrations, no wavelength dependence, and no aperture — real optics departs from this in all three ways.
  • The object is always placed on the axis, so off-axis behaviour is not modelled.
  • Problems are not stored between visits; seed one you want again.

Privacy and your data

The lens problem and its solution are worked out in your browser alone, and nothing about them is transmitted or stored.