With f = 10 cm and the object 30 cm away, the image forms 15 cm beyond the lens: real, inverted, reduced (m = −0.5).
Converging lens: ray diagram (heights stretched to fit)
How it's calculated S
Solve the thin-lens / mirror equation
di1=f1−do1=0.11−0.31⇒di=0.15m
Magnification
m=−dodi=−0.30.15=−0.5,hi=mho=−0.01m
Sign convention
Real is positive: distances to real objects and images are positive, virtual ones negative; converging lenses and concave mirrors have f > 0. For a lens a real image forms on the far side.
About the thin lens, mirror and Snell's law calculator
The thin-lens equation, 1/f = 1/dₒ + 1/dᵢ, links the focal length f, the object distance dₒ and the image distance dᵢ, and the same equation holds for spherical mirrors. Give any two and the calculator solves the third, then finds the magnification m = −dᵢ/dₒ, the image height, whether the image is real or virtual, and the power in dioptres (1/f with f in metres). Snell's law, n₁ sin θ₁ = n₂ sin θ₂, gives the refracted angle at a boundary and the critical angle beyond which light is totally reflected.
With the defaults, a converging lens of f = 10 cm and an object 30 cm away, the image forms 15 cm behind the lens, inverted and half size (m = −0.5), the arrangement in a camera. Light passing from air into water at 45° bends to 32.05°.
Signs follow the real-is-positive convention: virtual images have negative dᵢ, and diverging lenses and convex mirrors have negative f. Lenses are thin, so thickness and aberrations are ignored.
Worked examples
Converging lens f = 10 cm, object at 30 cm
Calculate
Lens or mirror
Element
Converging lens
Solve for
Image distance
Focal length (size, without sign)
10 cm
Object distance
30 cm
Show distances in
cm
Image distance
15 cm
Magnification
-0.5
Image
Real, inverted, reduced
Optical power
10 D
Checked against: Python 3.8 fractions: 1/dᵢ = 1/10 − 1/30 ⇒ dᵢ = 15 cm, m = −½; P = 1/0.1 m
1/f = 1/dₒ + 1/dᵢ, where f is the focal length, dₒ the object distance and dᵢ the image distance, all measured from the lens. For f = 10 cm and an object at 30 cm, 1/dᵢ = 1/10 − 1/30, so dᵢ = 15 cm. A negative dᵢ means a virtual image on the same side as the object, as seen through a magnifying glass.
How do you calculate the magnification of a lens?
m = −dᵢ/dₒ, and the image height is m times the object height. A negative m means the image is inverted; |m| above 1 means it is enlarged. An object 5 cm from a 10 cm magnifying glass gives dᵢ = −10 cm and m = +2, an upright virtual image twice the size. At dₒ = 2f the image is real, inverted and the same size (m = −1).
What is the critical angle for total internal reflection?
θc = arcsin(n₂/n₁), which exists only when light heads into a medium with a lower index (n₁ > n₂). Into air it is 41.8° from glass (n = 1.5), 48.6° from water (1.333) and 24.4° from diamond (2.417), which is why cut diamonds sparkle. A ray meeting the surface at more than θc from the normal is reflected completely, the principle behind optical fibre.
What is Snell's law?
n₁ sin θ₁ = n₂ sin θ₂: the refractive index times the sine of the angle from the normal is the same on both sides of a boundary. Light entering water (n = 1.333) from air at 45° continues at 32.0°, bent towards the normal because water has the higher index. Going the other way the ray bends away from the normal, and beyond the critical angle it cannot leave at all.
What is lens power in dioptres?
Power P = 1/f with f in metres, measured in dioptres (D). A converging lens with f = 10 cm has P = +10 D, and a diverging lens with f = −50 cm has −2 D. Spectacle prescriptions use this unit: short sight is corrected with negative (diverging) lenses and long sight with positive ones, and the powers of thin lenses in contact add.
How accurate is the thin lens, mirror and Snell's law calculator?
Accuracy depends on your inputs and the method's assumptions. Decimal arithmetic uses 50 significant digits, but estimates, numerical methods and source data can be less precise; the displayed rounding does not remove those limits. It is checked against 8 worked examples whose answers come from independent sources; for example, “Converging lens f = 10 cm, object at 30 cm” is checked against Python 3.8 fractions: 1/dᵢ = 1/10 − 1/30 ⇒ dᵢ = 15 cm, m = −½; P = 1/0.1 m.
Where does the method come from?
OpenStax University Physics Volume 3, §2.3 Spherical mirrors and §2.4 Thin lenses; OpenStax University Physics Volume 3, §1.4 Refraction and §1.5 Total internal reflection; Hecht, Optics (5th ed.), Table 4.1 — refractive indices.