---
title: "How a Lens Redirects Light Interactive Lab | Sandbox Physics"
description: "How do three principal rays locate and size an image?"
canonical_url: "https://sandboxphysics.com/labs/lens-optics/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/lens-optics/"
last_modified: "2026-10-27"
---

Optics · ray tracing

# Lenses & Refraction

**How do three principal rays locate and size an image?** A ray parallel to the axis bends through the focal point, a ray through the center goes straight on, and a ray through the near focal point leaves parallel to the axis. The image sits where they cross, or appear to cross, and the similar triangles they form give its size.

A transparent 3D lens is convex when the focal length is positive and concave when it is negative. Three principal rays refract through it in space and locate the image. Drag the object arrow or change the focal length, and the real or virtual image updates in place.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

Drag empty space to rotate the view, or drag the green object arrow to change its distance and height. Once the object crosses the focal point toward the lens, the dashed backward extensions of the rays meet at an upright virtual image.

Physics tutorial

## Lens imaging: organize all rays around the focus

**Background** A real lens refracts countless rays. The thin-lens approximation puts all of that refraction in one plane and sums up curvature and refractive index in a single focal length.

**Why it matters** For cameras, eyes, microscopes and telescopes, the first analysis comes down to image distance, magnification and whether the image is real or virtual.

Start with the essentials

- **Focus question**: When the object crosses the focal point, why does the image jump from a real image on the far side of the lens to a virtual image on the same side as the object?
- **One-sentence intuition**: The focal length sets the scale at which parallel rays converge. Whether the object sits farther or closer than the focal length decides whether the outgoing rays actually meet.

### Core mathematical model

#### Thin-lens equation

$$
\frac{1}{f}=\frac{1}{d_o}+\frac{1}{d_i}
$$

With one consistent sign convention, this single equation covers converging and diverging lenses, real images and virtual images.

#### Transverse magnification

$$
M=\frac{h_i}{h_o}=-\frac{d_i}{d_o}
$$

The magnitude gives the size ratio, and the sign tells you whether the image is upright or inverted.

### Common difficulties

#### A virtual image is still observable

**Typical misconception** A virtual image is only a drawing aid and cannot be seen.

**Better mental model** A virtual image cannot be projected onto a screen, but your eye or another lens can still receive it, because the rays look as if they come from that point.

#### Principal rays are not the only rays

**Typical misconception** The object emits only the three rays drawn in the diagram.

**Better mental model** They are just three convenient rays for finding the image. Every paraxial ray obeys the same imaging relation.

### Run the experiment

1. 01

   #### Form a reduced real image

   Place the object beyond 2F.

   **What to observe:** The rays meet on the far side of the lens and form a smaller, inverted image.

2. 02

   #### Cross the focus

   Move the object slowly inside F.

   **What to observe:** The image distance runs off to infinity and changes sign, and the image becomes upright and virtual.

3. 03

   #### Use a diverging lens

   Set the focal length to a negative value.

   **What to observe:** The outgoing rays spread apart. Traced backward, they meet at a smaller virtual image.

Physical conclusion

First decide where the object sits relative to the focal point and twice the focal length, then calculate with a consistent sign convention.

## Related experiments and articles

Continue exploring

### Images and principal rays

Move the object through the focus. Which rays still locate the image?

1. [You are here **Lenses & Refraction** Begin with the three principal rays and image orientation.](https://sandboxphysics.com/labs/lens-optics/)
2. [Lab **Thin Lens Imaging Bench** Move the object on the bench and compare real and virtual images.](https://sandboxphysics.com/labs/thin-lens-imaging-bench/)

Waves & optics · Starter path

## From one ray to interference measurement

Start with refraction, find where the ray picture stops working, then use interference to measure tiny distances.

[Start here → **Optical Boundary Explorer** Turn the incident angle and watch reflected and transmitted power trade off. Then switch to the critical-angle scene. Observe · 11 min](https://sandboxphysics.com/labs/optical-boundary-explorer/)

1. [1 Optical Boundary Explorer](https://sandboxphysics.com/labs/optical-boundary-explorer/)
2. [2 Rainbow Caustic Observatory](https://sandboxphysics.com/labs/rainbow-laboratory/)
3. [3 Camera Obscura](https://sandboxphysics.com/labs/camera-obscura/)
4. [4 Coherent Wave Composer](https://sandboxphysics.com/labs/coherent-wave-composer/)
5. [5 Young Double-Slit Bench](https://sandboxphysics.com/labs/young-double-slit-bench/)
6. [6 Michelson Precision Lab](https://sandboxphysics.com/labs/michelson-precision-lab/)

[View the full path →](https://sandboxphysics.com/topics/waves-and-optics/#starter-path)
