Drag the object arrow along the axis
Controls
Lens type
Place the object
Readings
- Object distance, u
- -30.0cm
- Image distance, v
- 15.0cm
- Focal length, f
- 10.0cm
- Power, P
- 10.00D
- Magnification, m = v/u
- -0.50
- Image height, h′
- -2.5cm
- Nature of the image
- Real, inverted, diminished
How to use this simulation
- Choose a convex or a concave lens. The focal points F and the points 2F are marked on both sides.
- Drag the blue object arrow along the axis, or use the object-distance slider.
- Use the "Place the object" buttons to jump straight to each textbook case: very far, beyond 2F, at 2F, between F and 2F, at F, and between F and the lens.
- Orange lines are incident rays and red lines refracted rays. When the refracted rays truly meet, the green image is solid (real); when only their dashed backward extensions meet, the image is dashed (virtual).
- Read u, v, f, magnification, power and the nature of the image in the readings panel, then check them against the solved problems below.
Glasses, cameras and a magnifying glass: lenses are everywhere
Hold a magnifying glass in sunlight and focus the light onto a piece of paper, and the paper starts to smoke. Hold the same glass close to your eye over a line of ants, and the ants look huge. Same piece of glass, two completely different jobs. The difference is only how far the object is from the lens, and this whole page is about that one idea.
Spectacles, a phone camera, the school microscope, a cinema projector and the lens inside your own eye all obey the same small set of rules. Once you know them, three straight lines drawn with a ruler tell you where an image forms, whether it is upright or upside down, and whether it is bigger or smaller.
Ray diagrams often feel like something to memorise. They are not. Drag the object in the simulation a little at a time and you will see the image race away, flip over, vanish to infinity, and then reappear upright behind the object. By the end of this page you will know exactly why each of those things happens.
From zero: what a lens is and why it bends light
When light passes at an angle from one medium into another, for example from air into glass, it changes direction. That is refraction. Light travels more slowly in glass, so it bends towards the normal as it enters and away from the normal as it leaves.
A lens is a piece of glass or plastic with at least one curved (spherical) surface. Because the surface is curved, light hitting different parts of the lens bends by different amounts: a lot near the edges and hardly at all near the middle. That graded bending is what gathers parallel light to a point, or spreads it out.
There are two main kinds. A convex lens is thicker in the middle than at the edges. It brings parallel rays together at one point, so it is also called a converging lens. A concave lens is thinner in the middle than at the edges. It spreads parallel rays apart so they seem to come from a point in front of the lens, so it is called a diverging lens.
A quick memory trick: a convex lens bulges outwards and pulls rays in; a concave lens "caves in" and pushes rays out.
Key words you need
Before drawing anything, let us pin down the vocabulary. Definition questions in exams come straight from this list, and every symbol in the simulation is one of these.
| Term | Symbol | Meaning in plain words |
|---|---|---|
| Optical centre | O | The centre of the lens; a ray through it goes straight on |
| Principal axis | — | The straight line through the optical centre and both centres of curvature |
| Centre of curvature | C | The centre of the sphere each lens surface is part of; a lens has two |
| Principal focus | F | Where rays parallel to the axis meet after refraction (convex), or seem to come from (concave) |
| Focal length | f | Distance from the optical centre to the principal focus |
| Object distance | u | Distance from the optical centre to the object |
| Image distance | v | Distance from the optical centre to the image |
| Magnification | m | Image height ÷ object height = v/u |
| Power | P | How strongly the lens bends light; P = 1/f with f in metres, unit dioptre (D) |
| Real image | — | Formed where rays actually meet; can be caught on a screen; always inverted |
| Virtual image | — | Rays only appear to meet; cannot be caught on a screen; upright |
The three golden rules for drawing rays
Countless rays leave the tip of an object, but to find the image you only need two whose paths you already know. The simulation draws all three so you can see that they meet at the same point; in an exam any two are enough.
Rule 1: a ray parallel to the axis passes through the focus
For a convex lens, a ray travelling parallel to the principal axis passes through the principal focus F on the far side after refraction. For a concave lens it spreads out as if it came from the focus on the near side (the object side). Pick the concave lens with virtual extensions switched on, and the dashed line lands exactly on the near F.
Rule 2: a ray through the optical centre goes straight on
Near the optical centre the two surfaces of a thin lens are almost parallel, like a thin glass slab, so this ray leaves without changing direction. It is the easiest ray of all: put your ruler on the tip of the object and the point O and draw.
Rule 3: a ray through the focus leaves parallel to the axis
For a convex lens, a ray that passes through the focus on the object side comes out parallel to the principal axis. It is Rule 1 run backwards, because light paths are reversible. For a concave lens, a ray aimed at the focus on the far side comes out parallel.
Convex lens ray diagram: all six cases
This is the table that turns up in almost every exam. Each row also has an example worked out for the simulation's default lens (f = 10 cm) in the Cartesian sign convention. Press the "Place the object" buttons to check each row with your own eyes.
| Object position | Image position | Nature and size of image | Example (f = 10 cm) |
|---|---|---|---|
| At infinity | At F | Real, inverted, highly diminished (point-sized) | v → infinity |
| Beyond 2F | Between F and 2F | Real, inverted, diminished | u = -30, v = 15, m = -0.50 |
| At 2F | At 2F | Real, inverted, same size | u = -20, v = 20, m = -1 |
| Between F and 2F | Beyond 2F | Real, inverted, magnified | u = -15, v = 30, m = -2 |
| At F | At infinity | Real, inverted, highly magnified (no usable image) | v → infinity |
| Between F and O | Same side as the object | Virtual, erect, magnified | u = -6, v = -15, m = 2.50 |
Concave lens ray diagram: always the same answer
A concave lens is simple. An object at infinity gives a point-sized image at the focus. An object anywhere between infinity and the lens gives an image between the focus and the lens, on the same side as the object. Every time the image is virtual, upright and smaller than the object.
Choose the concave lens and drag the object from far away right up to the lens. The dashed green image never crosses F and never flips. It grows a little as the object approaches but never reaches the size of the object. That wide, shrunken view is exactly what a door peephole gives you.
The lens formula: 1/v − 1/u = 1/f
Ray diagrams tell you where an image is; the lens formula lets you calculate it. In the Cartesian sign convention (used by NCERT and most international syllabuses), distances are measured from the optical centre: positive in the direction light travels, negative against it. A real object on the left therefore has a negative u, a convex lens has a positive f, and a concave lens a negative f.
1/v − 1/u = 1/flens formula, Cartesian sign convention
v = uf / (u + f)rearranged for the image distance
m = h′/h = v/umagnification; negative means real and inverted, positive means virtual and erect
P = 1/f (f in m) = 100/f (f in cm)power of a lens, in dioptres (D)
Where the formula comes from (sketch)
Let the object AB stand on the axis with its tip at A. The ray from A through the optical centre O goes straight on; the ray from A parallel to the axis refracts through F. They meet at the image tip A′. Triangles ABO and A′B′O are similar, so A′B′/AB = OB′/OB.
The parallel ray meets the lens at a point P at the same height as A, so triangles POF and A′B′F are similar too, giving A′B′/AB = B′F/OF. Setting the two ratios equal and writing the distances with their signs (OB = −u, OB′ = v, OF = f) gives v/(−u) = (v − f)/f. Dividing through by uvf and tidying up gives 1/v − 1/u = 1/f.
The other convention: real-is-positive (1/u + 1/v = 1/f)
Some syllabuses, including the NCTB books in Bangladesh, use the real-is-positive convention: real object and image distances are positive and virtual ones negative, so the formula reads 1/u + 1/v = 1/f. Both conventions give the same distances for the same problem; only the meaning of the signs differs. Use whichever your own textbook uses and never mix them in one answer.
Things to try in the simulation
Reading about lenses sticks for a week; doing it sticks for years. Try each of these in turn, and predict what will happen before you move anything.
- Put the object at 20 cm (2F). The readings show v = 20 cm and m = -1: an image exactly the same size as the object, just upside down.
- Drag the object slowly towards F. The image races to the right and grows; exactly at F the refracted rays leave parallel and the image is at infinity.
- Move just inside F. The image suddenly appears behind the object, upright and dashed. That is a magnifying glass.
- Increase the focal length: at the same object distance the image moves farther away. A fatter, more curved lens has a shorter focal length and more power.
- With the concave lens, put the object anywhere. The nature line never changes: virtual, erect, diminished.
- Switch on light pulses and slow the speed to 0.25×. Light travels from the object to the lens and then onwards. It never travels along the dashed lines; those only show where the eye thinks the light came from.
Solved problems (Cartesian convention)
Every number below is calculated from the formula, and the first problem is the simulation’s default setting. After each one, set the same values in the simulation and compare.
Problem 1: object 30 cm from a convex lens of focal length 10 cm
u = −30 cm and f = +10 cm. From 1/v = 1/f + 1/u = 1/10 − 1/30 = 1/15 per cm.
So v = +15 cm, and m = v/u = 15/(−30) = -0.50. A positive v means a real image on the far side; the negative m means inverted, and |m| < 1 means diminished. The object is beyond 2F and the image lands between F and 2F, just as the table says.
Problem 2: object at 2F (20 cm)
1/v = 1/10 − 1/20, so v = +20 cm and m = -1. The image is at 2F on the other side: real, inverted and the same size. This is how a photocopier lens makes a 1:1 copy.
Problem 3: object between F and 2F (15 cm)
1/v = 1/10 − 1/15, so v = +30 cm and m = -2. The image lies beyond 2F: real, inverted and magnified. A projector uses exactly this position, which is why the slide goes in upside down.
Problem 4: a magnifying glass, object at 6 cm
Now u = −6 cm, closer than f = 10 cm. 1/v = 1/10 − 1/6 is negative, so v = -15 cm.
A negative v means the image is virtual, on the same side as the object, 15 cm from the lens. m = v/u = 2.50: positive, so erect, and greater than 1, so magnified. That is why the ant looks big and the right way up.
Problem 5: concave lens of focal length 15 cm, object at 30 cm
For a concave lens f = -15 cm and u = −30 cm. 1/v = 1/f + 1/u = −1/15 − 1/30, so v = -10 cm.
The image is virtual, 10 cm from the lens on the object side, with m = 0.33: erect and diminished. Set concave, |f| = 15 cm and object 30 cm in the simulation to check.
Problem 6: power, and two lenses together
A convex lens of focal length 25 cm has power P = 100/25 = +4 D. A concave lens of focal length 50 cm has power P = 100/(-50) = -2 D.
Thin lenses in contact add their powers: 4 + (-2) = 2 D. The combination therefore has a focal length of 100/2 = 50 cm, and since the total power is positive it behaves like a convex lens.
Problem 7: focal length from an image on a screen
In the lab a candle 24 cm in front of a convex lens gives a sharp image on a screen 40 cm behind it. With u = −24 and v = +40: 1/f = 1/40 + 1/24, so f = 15 cm and P = 6.67 D. That is the standard practical for finding the focal length of a convex lens.
Problem 8: how tall is the image?
If the object in Problem 3 is 2 cm tall, the image height is h′ = m × h = -2 × 2 = -4 cm. The minus sign means the image points downwards, so draw it below the axis. Set the object height to 2 cm in the simulation and read the image height.
Convex lens vs concave lens
For every "state the differences" question, here is the whole comparison at a glance:
| Feature | Convex lens | Concave lens |
|---|---|---|
| Shape | Thick in the middle, thin at the edges | Thin in the middle, thick at the edges |
| Effect on light | Converging | Diverging |
| Focus | Real focus | Virtual focus |
| Sign of f and P | Positive | Negative |
| Image | Real or virtual, depending on object position | Always virtual, erect, diminished |
| Uses | Magnifier, camera, projector, reading glasses | Glasses for myopia, door peephole, Galilean telescope |
Common mistakes
Examiners see these again and again. Check your own answers for each one.
- Forgetting that u is negative in the Cartesian convention and getting v with the wrong sign.
- Taking the focal length of a concave lens as positive. Both f and P are negative for a concave lens.
- Using f in centimetres in P = 1/f. For dioptres, f must be in metres, or use P = 100/f with f in cm.
- Drawing rays without arrowheads, or drawing virtual extensions as solid lines. Virtual parts are always dashed.
- Saying the image is "at F" when the object is at F. The refracted rays come out parallel, so the image is at infinity.
- Calling a real image erect. A single lens always forms real images inverted.
Lenses in real life
The eye: the eye lens is convex and forms a real, inverted image on the retina, which the brain reads the right way up. The ciliary muscles change the lens thickness to change its focal length; that is accommodation.
Spectacles: with myopia (short-sightedness), distant objects focus in front of the retina, so a concave lens with negative power is prescribed. With hypermetropia (long-sightedness), near objects focus behind the retina, so a convex lens with positive power is needed. A prescription of −1.5 or +2.0 is the lens power in dioptres.
Cameras and phones: the scene is far away (beyond 2F), so a small, real, inverted image forms on the sensor. Focusing moves the lens slightly so that the image falls exactly on the sensor.
Magnifiers and microscopes: an object inside F gives an upright, magnified virtual image. A compound microscope uses two convex lenses one after the other.
Projectors: a small slide placed between F and 2F throws a large real image onto a distant screen.
Exam corner
Lenses appear every year in Grade 10 physics (the "Light: reflection and refraction" chapter) and again in Grade 12 ray optics, as well as in JEE and NEET. The questions follow a handful of patterns:
- Definitions: principal focus, focal length, optical centre, power of a lens and its SI unit.
- Ray diagrams: draw the image for an object at a given position, usually between F and 2F or inside F, and state its nature.
- Numericals: given u and f, find v, m and the image height, with correct signs (as in Problems 1–5 and 8).
- Power: find P from f, or combine two thin lenses in contact (Problem 6).
- Applications: which lens corrects myopia or hypermetropia, and why.
Quick revision
If you only read one section the night before the exam, read this one.
- A convex lens converges light; a concave lens diverges it.
- Three rays: parallel → through F; through O → straight on; through F → parallel.
- Lens formula 1/v − 1/u = 1/f (Cartesian); magnification m = v/u = h′/h.
- P = 1/f with f in metres, unit dioptre; positive for convex, negative for concave.
- Convex lens: object outside F → real and inverted; inside F → virtual, erect, magnified.
- Object at 2F → same-size image at 2F; object at F → image at infinity.
- Concave lens → image always virtual, erect, diminished, between F and the lens.
- The simulation's default lens (f = 10 cm) has a power of +10 D.
Frequently asked questions
What is a convex lens?
A lens that is thicker in the middle than at its edges. It brings rays parallel to the principal axis together at a point after refraction, so it is also called a converging lens.
What is a concave lens?
A lens that is thinner in the middle than at its edges. It spreads parallel rays apart as if they came from a point in front of the lens, so it is called a diverging lens.
What is the power of a lens and its SI unit?
Power measures how strongly a lens converges or diverges light. It is the reciprocal of the focal length in metres, P = 1/f, and its SI unit is the dioptre (D).
When does a convex lens form a virtual image?
When the object is between the principal focus and the optical centre. The image is then on the same side as the object, erect and magnified. A magnifying glass works this way.
Can a concave lens form a real image?
Not of a real object. On its own a concave lens always forms a virtual, erect and diminished image, wherever the object is placed.
What does a negative magnification mean?
In the Cartesian convention a negative m means the image is real and inverted, and a positive m means it is virtual and erect. In the real-is-positive convention used by some syllabuses the meaning is reversed, so always check which convention you are using.
Where is the image when the object is at 2F?
At 2F on the other side of the lens: real, inverted and the same size as the object. With f = 10 cm and the object at 20 cm, v = +20 cm and m = -1.
Which lens is used to correct short-sightedness?
A concave lens. A short-sighted eye focuses distant objects in front of the retina; the concave lens spreads the rays slightly so the image moves back onto the retina.
Why are virtual rays drawn dashed?
Because no light actually travels along them. They are the backward extensions of the refracted rays, drawn to show where the eye perceives the light to have come from.
Keep studying this topic
The animation made the idea click; now turn it into marks. Syllabus, suggestions, textbooks and admission-test guides are below.
SSC
SSC General Science
Admission
Medical admission 2026-27
SSC
SSC Physics: syllabus and preparation
HSC
HSC Physics: syllabus and preparation
Textbook
Class 9-10 Physics textbook
Admission
Engineering admission test preparation
Admission
Dhaka University science unit admission 2026-27
English
Composition: The Uses of Electricity
Bangla
প্রতিবেদন: বিজ্ঞান মেলা (in Bangla)
English
Paragraph: Science in Everyday Life
SSC
SSC suggestions
HSC
HSC suggestions
Admission
University admission guide
SSC
SSC syllabus
HSC
HSC syllabus
More physics animations
Grade 8–12
Refraction of light
Change the angle and watch light bend. Snell's law, refractive index, critical angle and total internal reflection, explained simply with worked examples.
Grade 9–12
Ohm's law
Adjust voltage and resistance and watch the current change. Ohm's law formula, V-I graph, series and parallel resistors, with solved problems.
Grade 11
Projectile motion
Set the launch angle and speed and trace the path. Time of flight, maximum height and range formulas, why 45° goes farthest, with solved numbers.
Grade 9–11
Simple pendulum
Change length and gravity and time the swing. Simple pendulum period T = 2π√(L/g), SHM, energy conservation and finding g, with solved numbers.
Grade 10–12
Electric field
Drop positive and negative charges and watch the field lines form. Coulomb's law, E = kq/r², units and field-line rules, with solved examples.
Grade 11–12
Wave interference
Move two wave sources and watch bright and dark fringes appear. Superposition, constructive vs destructive conditions, fringe width, solved examples.
Grade 9–11
Free Fall
What is free fall? Drop a coin and a feather with and without air. Learn the free fall formulas for time, velocity and height (g = 9.8 m/s²) with worked examples.
Grade 9–11
Newton's Laws of Motion
Newton's laws of motion explained with an interactive cart: inertia, F = ma, momentum, impulse and action–reaction pairs, with examples and worked problems.
Grade 10–12
Spherical mirror ray diagrams
Drag an object in front of a concave, convex or plane mirror and watch the rays find the image. Mirror formula, magnification, all six cases, solved problems.
Grade 10–12
Electromagnetic Induction
What is electromagnetic induction? Drag a bar magnet through a coil and watch a centre-zero galvanometer. Learn Faraday's law e = −N dΦ/dt and Lenz's law with worked examples.
Grade 9–11
Conservation of Momentum and Collisions
What is the conservation of momentum? Collide two carts and drag the restitution slider from a sticking e = 0 to a bouncy e = 1. See momentum and kinetic-energy bars update live, with worked examples.
Grade 9–11
Work, Energy and Power
What is work, and what are the formulas for kinetic and potential energy and power? Release a cart on a curved track, watch energy turn to heat, with worked examples.
Grade 9–11
Inclined Plane
How does a block’s weight split on a slope, what is the angle of repose, and when does friction hold a block still or let it slide? Change the angle yourself and watch the force-arrow diagram.
Animations in other subjects
Chemistry
Structure of the atom
Chemistry
Acids, Bases and the pH Scale
Chemistry
Electron configuration
Chemistry
Gas laws: Boyle, Charles, Gay-Lussac, Avogadro and PV = nRT
Chemistry
How an Ionic Bond Forms
Chemistry
Electrolysis and Faraday’s Laws
Chemistry
Covalent Bond
Chemistry
Periodic Trends
Biology
Mitosis cell division
Biology
Diffusion and Osmosis
Biology
Photosynthesis
Biology
The human heart: structure and function
Biology
Mendelian Genetics
Biology
DNA Replication
Biology
Cellular Respiration
Biology
Enzyme Action
Biology
The Nerve Impulse and the Action Potential
Biology
The Nephron and Urine Formation
Biology
Meiosis Cell Division
Biology
Digestive System
Mathematics
Pythagorean Theorem
Mathematics
Trigonometric Ratios and the Unit Circle
Mathematics
Quadratic functions and their graphs
Mathematics
Circle theorems
Mathematics
Heights and distances: elevation and depression angles
Mathematics
Probability: experimental vs theoretical probability
Mathematics
Arithmetic and Geometric Sequences
Mathematics






















