Skip to main content
Sandbox Physics

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 modelLenses & Refraction
Image distance0 px
Magnification0.00×
Image typereal
Orientationinverted

Physics tutorial

Lens imaging: organize all rays around the focus

BackgroundA 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 mattersFor 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

1f=1do+1di\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=hiho=−didoM=\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 misconceptionA virtual image is only a drawing aid and cannot be seen.

Better mental modelA 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 misconceptionThe object emits only the three rays drawn in the diagram.

Better mental modelThey 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.

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 hereLenses & RefractionBegin with the three principal rays and image orientation.
  2. LabThin Lens Imaging BenchMove the object on the bench and compare real and virtual images.
FeedbackSomething broken, confusing, or missing on this page?Tell us
What kind of feedback?

Sent with this page’s address, its Lab ID, the site language and your device type. Please leave out personal details. Feedback is kept for up to 12 months.Privacy policy