Geometric optics calculator
Solve geometric optics problems from whatever data you have: refraction between two media with Snell's law, the critical angle and total internal reflection, apparent depth, the path of a ray through a prism and its minimum deviation, the image formed by a thin lens or a spherical mirror with its ray diagram drawn to scale, the lensmaker's equation and two-lens systems, such as a microscope. The sign convention is stated clearly and every step comes with its equation.
Theory and worked examples: Geometric optics: reflection, refraction, lenses and mirrors.
What you can do
- Reflection and refraction: n₁ sin θ₁ = n₂ sin θ₂, the critical angle (only if n₂ < n₁) and total internal reflection, the speed and wavelength in each medium and the apparent depth.
- Prism: the angles at both faces, the deviation, the minimum deviation and the index that follows from it, total reflection at the second face and the deviation curve.
- Thin lenses and spherical mirrors: 1/s + 1/s′ = 1/f, the magnification, whether the image is real or virtual and upright or inverted, the power in diopters and the ray diagram with the three principal rays.
- The lensmaker's equation, with flat faces (R = ∞) and lenses in another medium.
- Two-lens systems: the image of the first as the object of the second (virtual too), the total magnification and the equivalent focal length.
- Free data: type any combination and the unknowns come out; what does not exist (the critical angle when going into a medium of higher index) is explained.
Frequently asked questions
What is the critical angle?
The angle of incidence beyond which light going into a medium of lower index no longer gets out: sin θc = n₂/n₁. From glass (n = 1.50) into air, θc = 41.81°: at 30° the light leaves at 48.59°, but at 50° it is all reflected (total internal reflection). Going into a medium of higher index, as from air into water, there is no critical angle: at 30° it is refracted to 22.08°.
How is the image of a lens found?
With 1/s + 1/s′ = 1/f and m = −s′/s. A 20 cm converging lens with a 4 cm object at 30 cm gives a real image at 60 cm, inverted and twice as large (m = −2, y′ = −8 cm); its power is 5 diopters. A 10 cm magnifier with the object at 6 cm gives a virtual image 15 cm away on the same side, upright and 2.5 times larger.
Which sign convention is used?
"Real is positive", the one in most physics textbooks: s > 0 if the object is real, s′ > 0 if the image is real (behind the lens or in front of the mirror) and s′ < 0 if virtual; f > 0 for converging lenses and concave mirrors (f = R/2) and f < 0 for diverging lenses and convex mirrors. A concave mirror with R = 40 cm and a 3 cm object at 30 cm forms a real, inverted 6 cm image at 60 cm.
How is the index of a glass measured with a prism?
With the minimum deviation: n = sin((A + δmin)/2)/sin(A/2). A 60° prism with a minimum deviation of 37.2° has n = 1.500. With n = 1.5 and a ray entering at 45°, the deviation is 37.38°, a little more than the minimum, 37.18°.
Guide: refraction, prisms, lenses and mirrors
Geometric optics treats light as rays that travel in straight lines and only change direction when reflected or when going from one medium into another. It is enough to understand refraction, prisms, lenses, mirrors and instruments such as the magnifier or the microscope. This guide explains each case with examples checked in the tool; angles are always measured from the normal.
Reflection and refraction
At a surface, the reflected ray leaves at the same angle as it arrives. The one that goes into the other medium changes direction because light travels there at another speed, v = c/n (n is the refractive index, 1 in vacuum). The crests must match on both sides of the surface, and that gives Snell's law:
n₁·sin θ₁ = n₂·sin θ₂ v = c/n λ = λ₀/n
Entering a medium of higher index the ray bends towards the normal; going into a lower one it bends away, and beyond the critical angle, sin θc = n₂/n₁, it cannot get out: all the light is reflected (total internal reflection, the one of optical fibers). The frequency does not change from one medium to the other; the wavelength does. An object under water looks closer to the surface: looking almost straight down, its apparent depth is d′ = d·n₂/n₁.
The prism
The ray is refracted entering and leaving. Since the normals of the two faces make the apex angle A, the two inside angles add up to A, and the total deviation is δ = θ₁ + θ₂ − A. It has a minimum when the ray crosses symmetrically, and that is how the index is measured: n·sin(A/2) = n₀·sin((A + δmin)/2), with n₀ the medium around the prism. If inside the ray reaches the second face at more than the critical angle, it does not get out.
Thin lenses and spherical mirrors
With the "real is positive" convention a single equation works for lenses and mirrors:
1/s + 1/s′ = 1/f m = y′/y = −s′/s P = 1/f (f in meters, P in diopters)
- s > 0 if the object is real (in front).
- s′ > 0 if the image is real: behind a lens or in front of a mirror, where it can be caught on a screen; s′ < 0 if virtual.
- f > 0 for a converging lens and a concave mirror (f = R/2); f < 0 for a diverging lens and a convex mirror.
- m < 0: inverted image; |m| > 1: larger than the object.
The ray diagram confirms it with three rays from the tip of the object: the one parallel to the axis leaves through the focal point, the one through the center (or reaching the vertex of the mirror) keeps its slope and the one through the focal point leaves parallel. Where they cross, or where their extensions cross, is the image. If the object is exactly at the focal point, the rays leave parallel and there is no image. The focal length of a lens follows from its shape with the lensmaker's equation: 1/f = (n/nm − 1)·(1/R₁ − 1/R₂), with R > 0 if the center of the face is behind the lens and R = ∞ for a flat face.
Two-lens systems
One lens is solved after the other: the image of the first is the object of the second, at s₂ = d − s₁′. If that image falls behind the second lens, it is a virtual object (s₂ < 0). The total magnification is the product of the two, and the pair acts as one lens of focal length 1/feq = 1/f₁ + 1/f₂ − d/(f₁·f₂).
Worked examples
- Light from air into water (n = 1.33) at 30°. sin θ₂ = sin 30°/1.33, θ₂ = 22.08°: it bends towards the normal. There is no critical angle because it goes into a medium of higher index.
- From glass (n = 1.50) into air at 30°. sin θ₂ = 1.5·sin 30° = 0.75, θ₂ = 48.59°, and θc = arcsin(1/1.5) = 41.81°: at 50° all the light is reflected.
- A ray enters a plastic at 40° and is refracted at 26°. n = sin 40°/sin 26° = 1.466. A diamond with a critical angle of 24.4° with air has n = 1/sin 24.4° = 2.421, and light travels in it at 1.238×10⁸ m/s.
- A coin 1.2 m deep in water. Seen from above it looks 1.2/1.33 = 0.9023 m deep. Light of 589 nm in water: λ = 589/1.33 = 442.9 nm.
- A 60° prism with n = 1.5 at 45° incidence. θ₁′ = 28.13°, θ₂′ = 60° − 28.13° = 31.87°, θ₂ = 52.38° and δ = 45° + 52.38° − 60° = 37.38°. The minimum deviation is 37.18°, with the ray entering at 48.59°. At 20° incidence, θ₂′ = 46.82° exceeds the critical angle of the glass, 41.81°, and the ray does not get out. Under water (n₀ = 1.33), δmin drops to 8.653°.
- A 20 cm converging lens with a 4 cm object at 30 cm. 1/s′ = 1/20 − 1/30, s′ = 60 cm: a real, inverted image, m = −2 and y′ = −8 cm; P = 100/20 = 5 diopters. Newton's equation checks it: (30 − 20)·(60 − 20) = 400 = 20².
- A 10 cm magnifier with the object at 6 cm. s′ = −15 cm: a virtual image on the same side, upright and 2.5 times larger. A −15 cm diverging lens with the object at 30 cm gives s′ = −10 cm and m = 0.3333 (P = −6.667 D).
- Lensmaker's equation. A biconvex glass lens (n = 1.5) with R₁ = 20 cm and R₂ = −20 cm has f = 20 cm; a plano-convex one with R₁ = 15 cm and R₂ = ∞, f = 30 cm.
- A concave mirror with R = 40 cm and a 3 cm object at 30 cm. f = 20 cm and s′ = 60 cm: a real image in front of the mirror, −6 cm tall. A makeup mirror with f = 30 cm and the face at 15 cm gives a virtual image 30 cm behind it, twice as large. A convex safety mirror with f = −0.5 m and a 1.5 m car at 4 m gives s′ = −0.4444 m and a 0.1667 m image (m = 0.1111).
- Two lenses of 10 and 15 cm, 40 cm apart, with the object 15 cm from the first. s₁′ = 30 cm, s₂ = 40 − 30 = 10 cm, s₂′ = −30 cm: a virtual final image, M = (−2)·3 = −6. A microscope with a 1 cm objective and a 5 cm eyepiece 15 cm apart, with the object at 1.1 cm: s₁′ = 11 cm, s₂ = 4 cm, s₂′ = −20 cm and M = (−10)·5 = −50.
How to use the tool
- Under Kind of problem, choose the Problem: reflection and refraction, prism, thin lenses and spherical mirrors or two-lens system. For lenses, choose the Element (lens or mirror) and the Length unit, and check the lensmaker's equation if you need it.
- Under Data, type what you know and leave empty what you are looking for, with the signs of the convention. Each problem gives its indices (examples: air 1.00, water 1.33, glass 1.50). A flat face is typed «inf». If a quantity does not exist (the critical angle when going into a medium of higher index, the refracted ray in total reflection), the tool explains it.
- Look at the figure: the ray at the surface and the curve of θ₂ against θ₁, the path through the prism and its deviation curve, or the ray diagram to scale along the axis.
- Check the Step by step and the Detailed solution (PDF). The cases of this guide are under Examples.
Common mistakes
- Measuring the angles from the surface. In Snell's law they go from the normal.
- Looking for a critical angle when going into a medium of higher index. It only exists if n₂ < n₁.
- Mixing sign conventions. With "real is positive", a virtual image has s′ < 0 and a diverging lens f < 0; with another convention (the Cartesian one) the signs of the equation change.
- Forgetting the sign of the magnification. m < 0 means inverted, not smaller.
- Computing diopters with the focal length in centimeters. P = 1/f with f in meters: 20 cm is 5 D, not 0.05.
- With two lenses, measuring the final image from the first. s₂′ is measured from the second lens.
Further reading
The chapters on reflection, refraction, lenses and optical instruments of any university physics textbook. On Simuveliq, interference and diffraction explains what ray optics cannot (fringes, gratings and thin films) and waves and sound the relations v = λ·f that change here from one medium to another.
More tools
Versión en español
About Simuveliq · How we verify the calculations · Terms of use · Privacy policy · Contact