PhysicsIntermediate

Lens & Mirror Optics Simulator

Interactive geometric optics simulator with real-time ray tracing for converging and diverging lenses, concave and convex mirrors. Visualize image formation, calculate magnification, and explore thin lens and mirror equations.

Loading simulation...

Loading simulation, please wait

Lens & Mirror Optics Simulator

Verified Content: All equations, formulas, and reference data in this simulation have been verified by the Simulations4All team against authoritative sources including MIT OpenCourseWare physics courses, HyperPhysics, and the Optical Society of America. See verification log

Introduction

You have probably done this at least once: held a magnifying glass between the sun and a piece of paper, angling it until that brilliant white dot appeared. Then, if you waited long enough (and kept still enough), a thin curl of smoke rose up and the paper began to scorch. Here is what happens when you actually try this: the lens is gathering sunlight from across its entire surface and bending all those rays toward a single point. The sun delivers about 1,000 watts per square meter to Earth's surface, but concentrate that through a 10 cm diameter lens and you can focus roughly 8 watts into a spot smaller than a pinhead [1]. That is enough to ignite paper, char wood, or give you a painful lesson about where not to put your finger.

The elegant part is that this same phenomenon (light bending through curved surfaces to form images) explains how your eyes work, how cameras capture photographs, and how telescopes can see galaxies billions of light-years away. If you could trace each light ray from a distant star through a telescope's mirror to the eyepiece, you would find it follows the exact same mathematical rules as that magnifying glass in your backyard. What Newton and Huygens figured out in the 1600s still governs how we design everything from smartphone cameras to the James Webb Space Telescope [2].

Our simulator lets you experiment with converging lenses, diverging lenses, concave mirrors, and convex mirrors. You can slide the object back and forth, adjust the focal length, and watch the rays trace their paths in real time. No need to buy optical equipment or risk burning anything. Just drag the sliders and observe.

What Is Geometric Optics?

Here is the core idea: instead of treating light as waves (which it is, at a fundamental level), geometric optics treats light as rays. Straight lines that travel until they hit something, then bounce or bend according to simple rules. When a ray hits a mirror, it reflects at the same angle it arrived. When it passes through glass, it bends according to Snell's law. These approximations work remarkably well for anything larger than a few wavelengths of light [3].

What we discover when experimenting is that you can predict exactly where an image will form using just two simple equations. The thin lens equation (1/f = 1/do + 1/di) and the magnification formula (M = −di/do). That is it. Those two relationships describe the behavior of magnifying glasses, camera lenses, eyeglasses, telescope mirrors, and the lenses in your own eyes. The universe does not care about our intuition, but these equations work every single time.

Why do we still use geometric optics when we know light is electromagnetic waves? Because it works. For most practical optical design (cameras, projectors, microscopes, laser systems), the ray model gives accurate predictions with far less computational effort. You only need wave optics when dealing with diffraction, interference, or features comparable to the wavelength of light.

How the Simulator Works

ParameterSymbolRangeEffect
Object Distancedo5-200 cmMove the object relative to F and 2F to see real vs. virtual images form
Focal Lengthf5-100 cmShorter focal length means a "stronger" lens or mirror with more bending power
Object Heightho5-50 cmScales proportionally with magnification to give image height
Element Type-4 optionsChoose between converging lens, diverging lens, concave mirror, or convex mirror

The simulator draws three principal rays: one parallel to the axis (which passes through F after the lens), one through the center (which goes straight through), and one through the focal point (which emerges parallel). Where these rays intersect, that is where the image forms. If they diverge instead of converging, you trace them backward to find the virtual image.

Technical Deep-Dive: Ray Tracing and Image Formation

The Thin Lens and Mirror Equation

Here is the equation that governs every lens and mirror in this simulation [4]:

1/f = 1/do + 1/di

Rearranging to find the image distance:

di = (f × do) / (do − f)

Put an object 60 cm from a lens with 30 cm focal length. The math gives di = (30 × 60)/(60 − 30) = 60 cm. The image forms at 60 cm on the other side of the lens. Move the object closer or farther and watch di change. There is something satisfying about watching the math play out visually in real time.

Magnification: How Big Is the Image?

The magnification tells you two things: how big the image is compared to the object, and whether it is right-side-up or upside-down [5]:

M = hi / ho = −di / do

That negative sign contains all the orientation information. Positive M means upright (same orientation as object). Negative M means inverted (flipped). And the absolute value tells you relative size: |M| > 1 is magnified, |M| < 1 is diminished.

If you could slow this down enough to watch, you would see each ray carrying a tiny portion of the light from one point on the object. Where those rays converge (or appear to diverge from), that is where your eye perceives the corresponding image point.

The Lensmaker's Equation

Ever wonder why different glasses materials create different focal lengths? The lensmaker's equation connects focal length to physical shape [6]:

1/f = (n − 1)(1/R1 − 1/R2)

Here n is the refractive index (around 1.5 for typical glass, 1.7 or higher for specialty optical glass), and R1 and R2 are the radii of curvature of the two lens surfaces. More curved surfaces and higher refractive index both create shorter focal lengths. This is why high-index eyeglass lenses can be thinner while providing the same optical power.

Mirror Focal Length

For mirrors, there is a beautifully simple relationship [7]:

f = R / 2

The focal length is exactly half the radius of curvature. Curve a mirror more tightly and its focal length decreases. The center of curvature (the center of the imaginary sphere the mirror is carved from) sits at distance R from the mirror, while the focal point F sits at R/2.

Sign Conventions (Read This Carefully)

Sign conventions trip up more physics students than almost anything else in optics. Different textbooks use different systems. Our simulator follows the standard Cartesian convention [8]:

For Lenses:

  • do is positive (real object in front of the lens)
  • di is positive for real images (formed on the opposite side from object)
  • di is negative for virtual images (same side as object, cannot be projected)
  • f is positive for converging (convex) lenses
  • f is negative for diverging (concave) lenses

For Mirrors:

  • do is positive (object in front of mirror)
  • di is positive for real images (formed in front of mirror, can be projected)
  • di is negative for virtual images (appear behind mirror)
  • f is positive for concave mirrors (converging)
  • f is negative for convex mirrors (diverging)

The elegant part is that once you internalize these conventions, the same equation works for every lens and mirror. Plug in the right signs and it just works.

Learning Objectives

After working through this simulation, you should be able to:

  1. Trace the three principal rays through any converging or diverging lens and predict where they intersect
  2. Apply the thin lens equation (1/f = 1/do + 1/di) to calculate image position for any lens or mirror
  3. Determine whether an image is real or virtual based on ray behavior and sign of di
  4. Explain the difference between how concave and convex mirrors redirect light
  5. Calculate magnification and correctly interpret the sign (positive = upright, negative = inverted)
  6. Design simple optical systems by combining lenses and mirrors with known focal lengths

Exploration Activities

Activity 1: The Three Regions of a Converging Lens

Objective: Discover how object position completely determines image characteristics

Here is what happens when you actually try this with a real lens: the image does something completely different depending on where you place the object relative to the focal points.

Steps:

  1. Select "Converging Lens" and set f = 30 cm
  2. Place object beyond 2F (set do = 90 cm). The image is real, inverted, and diminished. You could project this on a screen.
  3. Move object between F and 2F (set do = 45 cm). Still real and inverted, but now magnified. This is how projectors work.
  4. Move object inside F (set do = 20 cm). The image flips to virtual, upright, and magnified. This is your magnifying glass.
  5. Record all three configurations and note the pattern.

Expected Result: The focal point is a boundary. Outside F: real images. Inside F: virtual images. The 2F point is where image and object are the same size.

Activity 2: Diverging Lens Behavior

Objective: Understand why diverging lenses always produce the same type of image

Steps:

  1. Select "Diverging Lens" and set f = 30 cm
  2. Try any object distance: 20 cm, 60 cm, 200 cm
  3. Notice the image is always virtual, upright, and diminished
  4. Observe how the rays diverge after passing through the lens

Expected Result: No matter where you place the object, a diverging lens produces a virtual, upright, diminished image. The rays can never converge because the lens spreads them apart. This is why nearsighted people need diverging lenses; they push the focal point back toward the retina.

Activity 3: Concave Mirror Magic

Objective: Explore the concave mirror and its ability to create both real and virtual images

Steps:

  1. Select "Concave Mirror" and set f = 30 cm
  2. Place object at do = 90 cm. Note the real, inverted, diminished image forming in front of the mirror.
  3. Move object to do = 45 cm. Image is now magnified but still real and inverted.
  4. Move inside F (do = 20 cm). Image flips to virtual, upright, magnified, appearing behind the mirror.
  5. Compare to the converging lens with the same parameters.

Expected Result: Concave mirrors behave almost identically to converging lenses. The equations give the same numbers. The only difference: real images form in front of the mirror instead of behind it.

Activity 4: Why Your Car's Side Mirror Lies to You

Objective: Understand convex mirror properties and their practical application

Steps:

  1. Select "Convex Mirror" and note that f is displayed as negative
  2. Try any object distance and observe the image is always virtual, upright, and diminished
  3. Notice the image appears behind the mirror surface
  4. Calculate how much smaller the image is compared to the object

Expected Result: Convex mirrors always produce virtual, upright, diminished images. Objects in mirror are closer than they appear because the image is smaller than reality. But the trade-off is worth it: convex mirrors show a much wider field of view, which is why we put them on cars.

Real-World Applications

  1. Eyeglasses and Contact Lenses - Your optometrist prescribes lenses in diopters (P = 1/f in meters). A -3D prescription means you need a diverging lens with f = -0.33 m. The lens shifts your focal point to compensate for eyes that focus too strongly (nearsighted) or too weakly (farsighted) [9].

  2. Reflecting Telescopes - The Hubble Space Telescope uses a concave primary mirror with f = 57.6 m to gather light from distant galaxies. Larger mirrors collect more light, allowing astronomers to see fainter and more distant objects. The James Webb's primary mirror is 6.5 m across [10].

  3. Compound Microscopes - Two converging lenses work together. The objective lens (short f) creates a magnified real image, which the eyepiece lens (longer f) magnifies again. Total magnification can exceed 1000x, enough to see individual cells and bacteria.

  4. Camera Autofocus - When you half-press a camera shutter, motors adjust the lens position to make di land exactly on the sensor. The thin lens equation determines how far the lens must move for objects at different distances.

  5. Car Side Mirrors - That "objects in mirror are closer than they appear" warning exists because convex mirrors reduce image size. But they also expand the field of view from about 15 degrees (flat mirror) to 60+ degrees, eliminating dangerous blind spots [11].

Reference Data

Optical SystemFocal LengthTypeCommon Use
Human eye (relaxed)17 mmConvergingDistance vision
Human eye (focused)14 mmConvergingNear vision (accommodation)
+2.0 D reading glasses50 cmConvergingPresbyopia correction
-3.0 D distance glasses-33 cmDivergingMyopia correction
50 mm camera lens50 mmConverging"Normal" photography
200 mm telephoto200 mmConvergingDistant subjects
Typical magnifying glass10-25 cmConverging2-4x magnification
Car side mirrorVaries (-100 to -200 cm)ConvexWide field of view
Makeup/shaving mirror15-30 cmConcaveMagnified face view
Hubble primary57.6 mConcaveSpace telescope

Challenge Questions

  1. Beginner: What type of image does a converging lens produce when the object sits exactly at the focal point? (Hint: What happens to the denominator in di = f × do / (do − f) when do = f?)

  2. Beginner: Why do convex mirrors always produce diminished images regardless of object position? (Hint: Think about where the virtual focal point is located.)

  3. Intermediate: An object is placed 40 cm from a converging lens with f = 15 cm. Calculate di and M. Describe the image completely (real/virtual, upright/inverted, magnified/diminished).

  4. Intermediate: How would you arrange two converging lenses to build a simple astronomical telescope? Where should the focal points of each lens be positioned relative to each other?

  5. Advanced: A person's near point has receded to 100 cm (normal is 25 cm). They want to read at 25 cm. What power (in diopters) must their reading glasses provide? Show your reasoning using the lens equation.

Common Misconceptions

MisconceptionWhat Actually Happens
Light rays are physical objects traveling as thin beamsRays are a mathematical tool. Real light spreads as wavefronts. The ray model is an approximation that works extremely well for most optical design.
Virtual images cannot be seenYou can see virtual images perfectly well. What you cannot do is project them onto a screen. The image in your bathroom mirror is virtual. So is every image you see through your eyeglasses.
Magnification always makes things biggerMagnification is a number. It can be fractional (diminished), greater than one (enlarged), positive (upright), or negative (inverted). A convex mirror has magnification less than 1.
Thicker lenses are strongerFocal length depends on curvature AND refractive index. High-index glass lets opticians make thinner lenses with the same optical power. Shape matters more than bulk.

Frequently Asked Questions

What determines whether an image is real or virtual?

A real image forms at a location where light rays actually converge. You can place a screen there and see the image projected onto it. Cameras, projectors, and your retina all capture real images [4]. A virtual image forms at a location where light rays only appear to originate when you trace them backward. The rays never actually pass through that point. You cannot project a virtual image, but you can see it by looking into the optical system. Bathroom mirrors, magnifying glasses held close, and car side mirrors all produce virtual images you view directly.

Why does the same equation work for both lenses and mirrors?

The elegant part is this: both systems redirect light to form images, and the geometry works out identically. A lens bends rays by refraction; a mirror bends them by reflection. But the mathematical relationship between object distance, image distance, and focal length ends up being the same [3]. The only differences are in sign conventions and which side of the element the image appears on.

How do bifocals and progressive lenses correct vision at multiple distances?

Bifocals contain two distinct lens regions with different focal lengths. Look through the top for distance, tilt your head down and look through the bottom for reading. Progressive lenses achieve the same effect with a continuous gradient of optical power from top to bottom, eliminating the visible line but requiring precise positioning.

What does "optical power in diopters" mean?

Optical power P = 1/f when f is measured in meters [8]. A +2D lens has f = 0.5 m (converging). A -3D lens has f = -0.33 m (diverging). Optometrists prescribe in diopters because powers add when lenses are placed in contact. Stack a +2D and a +3D lens and you get +5D total optical power.

Can focal length be negative?

Yes. Diverging lenses and convex mirrors have negative focal lengths by convention. This indicates that parallel incoming rays diverge after interacting with the element, appearing to emanate from a virtual focal point behind the lens or mirror. The sign tells you immediately whether the element converges or diverges light.

References

  1. HyperPhysics - Geometric Optics: Lens Concepts. Georgia State University. Available at: http://hyperphysics.phy-astr.gsu.edu/hbase/geoopt/lenscon.html

  2. MIT OpenCourseWare - 8.02 Physics II: Electricity and Magnetism, Geometric Optics Module. Available at: https://ocw.mit.edu/courses/8-02-physics-ii-electricity-and-magnetism-spring-2007/

  3. Khan Academy - Geometric Optics: Thin Lens Equation. Available at: https://www.khanacademy.org/science/physics/geometric-optics

  4. OpenStax College Physics - Chapter 25: Geometric Optics and Image Formation. Available at: https://openstax.org/books/college-physics/pages/25-introduction-to-geometric-optics

  5. The Physics Classroom - Image Characteristics for Converging Lenses. Available at: https://www.physicsclassroom.com/class/refrn/Lesson-5/Image-Characteristics-for-Converging-Lenses

  6. The Physics Classroom - The Mathematics of Lenses (Lensmaker's Equation). Available at: https://www.physicsclassroom.com/class/refrn/Lesson-5/The-Mathematics-of-Lenses

  7. HyperPhysics - Spherical Mirrors. Georgia State University. Available at: http://hyperphysics.phy-astr.gsu.edu/hbase/geoopt/mircon.html

  8. OpenStax University Physics Volume 3 - Chapter 2: Geometric Optics and Image Formation. Available at: https://openstax.org/books/university-physics-volume-3/pages/2-introduction

  9. American Academy of Ophthalmology - How Do Glasses Correct Vision? Available at: https://www.aao.org/eye-health/glasses-contacts/glasses-work

  10. NASA - James Webb Space Telescope: Technical Facts. Available at: https://webb.nasa.gov/content/about/faqs/facts.html

  11. SAE International - Side Mirror Field of View Standards. Available at: https://www.sae.org/standards/

  12. Nikon Imaging - Lens Technology Explained. Available at: https://www.nikonusa.com/en/learn-and-explore/

  13. Zeiss - Understanding Optical Lenses and Vision Correction. Available at: https://www.zeiss.com/vision-care/

About the Data

The optical parameters and focal lengths in this simulation come from standard physics references and manufacturer specifications. Human eye focal length values derive from physiological optics research. Eyeglass prescriptions follow international optometry standards. Telescope specifications come from NASA and observatory technical documentation. All values have been cross-referenced against multiple authoritative sources for accuracy.

How to Cite

Simulations4All. (2026). Lens & Mirror Optics Simulator. Retrieved from https://simulations4all.com/simulations/lens-mirror-optics

For academic work, you may also cite the primary physics sources listed in the References section above, particularly OpenStax College Physics and MIT OpenCourseWare materials.

Verification Log

Claim/DataSourceVerification StatusDate Verified
Thin lens equation: 1/f = 1/do + 1/diMIT OCW, HyperPhysics, OpenStaxVerifiedJan 2026
Magnification formula: M = −di/doOpenStax, Khan Academy, Physics ClassroomVerifiedJan 2026
Mirror focal length: f = R/2HyperPhysics, OpenStaxVerifiedJan 2026
Lensmaker's equationPhysics Classroom, OpenStaxVerifiedJan 2026
Human eye focal length approximately 17 mm relaxedAAO, medical optics literatureVerifiedJan 2026
Optical power P = 1/f in dioptersOpenStax, optometry standardsVerifiedJan 2026
Sign conventions for lenses and mirrorsOpenStax Chapter 25, MIT OCWVerifiedJan 2026
Hubble primary mirror f = 57.6 mNASA specificationsVerifiedJan 2026
Solar irradiance approximately 1000 W/m^2NREL, NASA solar dataVerifiedJan 2026
James Webb primary mirror 6.5 m diameterNASA Webb mission factsVerifiedJan 2026

Written by Simulations4All Team

Related Simulations

Simple Pendulum
Physics
beginner
1,533

Simple Pendulum

Explore the physics of simple harmonic motion with an interactive pendulum simulation. Adjust length, mass, gravity (including planet presets), damping, and initial angle. Watch real-time energy transformations and measure the period.

View Simulation
Projectile Motion
Physics
beginner
1,260

Projectile Motion

Launch projectiles at different angles and velocities. Explore how gravity and launch parameters affect trajectory, range, and height. Compare with and without air resistance, and test on different planets.

View Simulation
Electric Field Visualization
Physics
intermediate
894

Electric Field Visualization

Visualize electric field lines, vectors, and equipotential surfaces around point charges. Add, drag, and remove charges to explore how fields interact. Launch test charges to see their motion through the field.

View Simulation

Stay Updated

Get notified about new simulations and educational content. We send 1-2 emails per month.