Skip to content
Simulation · Light

Lens and mirror ray diagrams

Slide a candle along the principal axis and watch the three rays find the image: real or virtual, bigger or smaller, upright or upside down.

Drag the object along the axis
Lens or mirror
15 cm
10 cm
Image distancev = +30.0 cm
Magnification−2×
Image height−4.0 cm
Object distanceu = −15 cmNew Cartesian sign convention
Lens power+10 D

Three rays find the image

A ray parallel to the axis bends through the focus. A ray through the optical centre goes straight on. A ray through the near focus comes out parallel. Where they cross is the image.

any two rays fix the image

The lens formula sets where

Distances are measured from the optical centre, positive in the direction the light travels, so the object distance u is negative. A convex lens has positive f, a concave lens negative.

1/v − 1/u = 1/f

Magnification sets how big

A negative m means a real, inverted image on the far side. A positive m means a virtual, upright image on the same side as the object. Mirrors use 1/v + 1/u = 1/f and m = −v/u.

m = h′/h = v/u

Where does a convex lens form the image?

It depends only on where the object sits compared with the focus F1 and the point 2F1, twice the focal length away. Beyond 2F1 the image is real, inverted and smaller, between F2 and 2F2. At 2F1 it is the same size at 2F2. Between F1 and 2F1 it is enlarged and beyond 2F2. At F1 it goes off to infinity, and inside F1 the lens becomes a magnifying glass: the image is virtual, upright and enlarged, on the same side as the object. The lens formula 1/v − 1/u = 1/f gives the exact distance and m = v/u gives the size.

The default setup is the worked example from the NCERT Class 10 chapter on light: a 2 cm object 15 cm in front of a convex lens of focal length 10 cm. With u = −15 cm the formula gives v = +30.0 cm and m = −2.00, so the image is 4 cm tall, real and inverted. Drag the candle and every ray, the image and the numbers update. For the physics of why light bends at all, see why a rainbow sits at 42 degrees and the refraction simulator.

Key results from the simulation

  • Three rays are enough, and two will do: a ray parallel to the axis bends through F2, a ray through the optical centre O goes straight on, and a ray through F1 comes out parallel. Any two of them cross at the image.
  • The sign tells you the nature: for a 10 cm convex lens, an object at 30 cm gives v = +15.0 cm and m = −0.50 (real, inverted, smaller); at 5 cm it gives v = −10.0 cm and m = +2.00 (virtual, upright, twice the size).
  • 2F is the break-even point: an object at 2F1 (20 cm) makes an image at 2F2 (+20.0 cm) with m = −1.00. Closer than that the image grows, farther away it shrinks.
  • A concave lens never makes a real image: at 20 cm a 10 cm concave lens gives v = −6.7 cm and m = +0.33. Wherever the object is, the image is virtual, upright, smaller and between F1 and O.
  • Power is 1 / f in metres: f = +10 cm is +10 dioptres; a concave lens of f = −50 cm is −2 D, the kind of number on a prescription for short sight.

The six positions of the object for a convex lens

Each case is a row of the table in the NCERT Class 10 chapter on light, with the numbers the simulation gives for a convex lens of focal length 10 cm and a 2 cm candle. The button sets the same position on the stage.

Object beyond 2F1: the camera case

Real, inverted, diminished

Put the candle 30 cm from the lens, three focal lengths away. The ray parallel to the axis bends down through F2, the ray through O carries on straight, and the ray through F1 leaves parallel to the axis. They meet 15 cm behind the lens, between F2 and 2F2, and the image is 1 cm tall and upside down: m = −0.50.

This is how a camera and your eye work. The scene is far away compared with the focal length, so the image lands just behind F2 on the sensor or retina, small and inverted. Your brain flips it. Move the candle farther and the image creeps toward F2 and shrinks.

u −30 cm v +15.0 cm m −0.50 Image Between F2 and 2F2

Object at 2F1: same size, upside down

Real, inverted, same size

At u = −20 cm, exactly twice the focal length, the formula gives v = +20.0 cm. The image sits at 2F2 and m = −1.00: the same size as the object but inverted. The diagram is symmetric, which is a quick way to check a hand-drawn one.

This is also the shortest possible distance between an object and its real image for a convex lens: 4f, here 40 cm. A copier lens set to 100 percent uses this arrangement.

u −20 cm v +20.0 cm m −1.00 Image At 2F2

Object between F1 and 2F1: the projector case

Real, inverted, enlarged

Move the candle to 15 cm. Now the rays cross far behind the lens, at v = +30.0 cm, beyond 2F2, and the image is 4 cm tall: m = −2.00. This is the NCERT worked example, so you can check your answer against the stage.

A slide or film projector does exactly this: a small, brightly lit slide just outside the focal length makes a large real image on a distant screen. The slide goes in upside down so the picture comes out the right way up.

u −15 cm v +30.0 cm m −2.00 Image Beyond 2F2

Object at F1: the image runs off to infinity

Real, inverted, highly enlarged at infinity

At u = −10 cm the formula gives 1/v = 1/10 − 1/10 = 0, so v is infinite. In the simulation the rays leave the lens parallel to each other and never meet. NCERT calls the image "infinitely large or highly enlarged" at infinity.

Run it backwards and you have a searchlight or a torch: a lamp at the focus sends out a parallel beam. The ray through F1 is missing from the diagram here because it would run along the lens and never reach it.

u −10 cm v infinity m infinite Rays Leave parallel

Object between F1 and O: the magnifying glass

Virtual, erect, enlarged

Inside the focal length the lens cannot bend the rays enough to bring them together. They leave the lens spreading apart, and traced backwards (the dashed lines) they appear to come from a point on the object's own side. At u = −5 cm that point is at v = −10.0 cm, and the image is 4 cm tall and upright: m = +2.00.

You cannot catch this image on a screen, which is what "virtual" means, but your eye can look through the lens and see it. That is a magnifying glass, and the reason a reading lens works best when you hold it closer to the page than its focal length.

u −5 cm v −10.0 cm m +2.00 Image Same side as object

Concave lens: always virtual, upright and smaller

Virtual, erect, diminished

Switch to a concave lens. The parallel ray now bends away from the axis, as if it came from F1 on the object's side (the dashed line), and the ray aimed at F2 leaves parallel. The rays never meet on the far side. Their backward extensions meet between F1 and O: at u = −20 cm, v = −6.7 cm and m = +0.33.

Move the object anywhere and the image stays virtual, erect and smaller, which is why a concave lens has only two rows in the NCERT table. Even at 5 cm, v = −3.3 cm and m = +0.67. Spectacles for short sight and door peepholes use concave lenses.

f −10 cm v −6.7 cm m +0.33 Power −10 D

Image formation by a convex lens (f = 10 cm, object 2 cm tall)

Object positionvmImage positionSizeNature
At infinity+10.0 cmabout 0At F2Highly diminished, point-sizedReal, inverted
Beyond 2F1 (30 cm)+15.0 cm−0.50Between F2 and 2F2DiminishedReal, inverted
At 2F1 (20 cm)+20.0 cm−1.00At 2F2Same sizeReal, inverted
Between F1 and 2F1 (15 cm)+30.0 cm−2.00Beyond 2F2EnlargedReal, inverted
At F1 (10 cm)infinityinfiniteAt infinityHighly enlargedReal, inverted
Between F1 and O (5 cm)−10.0 cm+2.00Same side as the object (behind it)EnlargedVirtual, erect

Values from the lens formula in the New Cartesian sign convention: u is negative, f is positive for a convex lens, positive v means a real image on the far side. For the object at infinity the image is a point in the focal plane at F2.

How the simulation works

The stage uses the convention in the NCERT book. The object stands to the left, light travels left to right, and distances are measured from the optical centre O (lenses) or the pole P (mirrors). Distances in the direction of the light are positive, so the object distance u is always negative. A convex lens and a convex mirror have positive f; a concave lens and a concave mirror have negative f. The lens formula 1/v − 1/u = 1/f and m = v/u give the image; for mirrors the stage uses 1/v + 1/u = 1/f and m = −v/u.

The rays are not decoration. Each is a straight line through the top of the object, bent at the lens plane by the textbook rule, and a test in the site's code checks that every drawn ray passes through the image point the formula predicts. When the image is virtual the stage draws the backward extensions as dashed lines, the way an exam answer should.

Heights are drawn larger than lengths, as in every textbook figure, so the rays do not look like slivers. Stretching the vertical scale keeps straight lines straight and keeps F, O and the image in the same places, so the construction stays exact. The graph under the diagram plots v against the object distance for the chosen lens or mirror: a hyperbola with a jump at F.

A worked check with mirrors: a 4 cm object 25 cm in front of a concave mirror of focal length 15 cm gives v = −37.5 cm and an image −6.0 cm tall, which is NCERT's mirror example. A car's convex mirror of radius 3 m shows a bus 5 m behind at 1.15 m behind the glass and 0.23 times its size, which is why "objects in mirror are closer than they appear".

What the model leaves out

  • Thick lenses: the lens is treated as thin, so all bending happens at one plane through O. A real lens bends light at both surfaces, which matters when the lens is thick compared with the distances.
  • Aberrations: a real spherical lens focuses edge rays a little closer than central rays (spherical aberration) and different colours at slightly different points (chromatic aberration). The model is paraxial: rays close to and nearly parallel to the axis.
  • Brightness: the stage does not show how much light reaches the image. A large magnification spreads the same light over a larger area, so a projector image is much dimmer per square centimetre than the slide.
  • Mirror shape: the mirrors are drawn slightly curved but the rays reflect as if from the plane through the pole, which is the same paraxial approximation as the mirror formula.
  • Object height: the object is drawn taller than its scale length so the rays are easy to see. The numbers use the true height you pick.

Common misconceptions

"If you cover half the lens you get half the image." No. Every part of the lens sends light from every part of the object to the image, so covering half of it gives the whole image, just dimmer. The NCERT question about a lens half covered with black paper makes exactly this point.

"A virtual image is not real, so it does not exist." It exists in the sense that your eye and a camera can see it, and you can measure where it is. It just cannot be caught on a screen, because no light actually passes through the image point.

"The image distance is always positive." Only for real images formed by a lens. In the NCERT convention a virtual image formed by a lens has negative v, and a real image formed by a mirror also has negative v, because both are on the side the light came from.

Frequently asked questions

What are the rules for drawing a ray diagram of a convex lens?

Draw two of these three rays from the top of the object. A ray parallel to the principal axis passes through the focus F2 after refraction. A ray through the optical centre O goes straight through without bending. A ray through the focus F1 comes out parallel to the principal axis. The image is where the rays meet, or where their backward extensions meet if they spread apart.

Where is the image when the object is at 2F1 of a convex lens?

At 2F2 on the other side of the lens. The image is real, inverted and the same size as the object. For a lens of focal length 10 cm and an object at 20 cm, the lens formula gives v = +20.0 cm and m = −1.00.

When does a convex lens form a virtual image?

Only when the object is between the focus F1 and the optical centre O, closer than one focal length. The image is then virtual, erect and enlarged, on the same side as the object. A 10 cm lens with the object at 5 cm gives v = −10.0 cm and m = +2.00, which is how a magnifying glass works.

What is the sign convention for lenses in NCERT?

Distances are measured from the optical centre. Distances in the direction of the incident light (to the right when the object is on the left) are positive, distances against it are negative. Heights above the principal axis are positive. So u is always negative, f is positive for a convex lens and negative for a concave lens, and the lens formula is 1/v − 1/u = 1/f with m = v/u.

Why does a concave lens always form a virtual image?

A concave lens spreads light out. Rays from the object leave it diverging, so they never cross on the far side. Traced backwards they meet between F1 and the lens, giving an image that is virtual, upright and smaller wherever the object is. For a 10 cm concave lens and an object at 20 cm, v = −6.7 cm and m = +0.33.

Keep learning

More simulations