Lens Magnification & Ray Tracing Simulator Back
光学

Lens Magnification & Ray Tracing Simulator

Change focal length and object distance to calculate image position, magnification, and real/virtual nature in real time. Confirm principal ray paths via Canvas ray diagram for converging and diverging lenses.

Parameters

Preset
実像・倒立
像距離 b
倍率 m
Image Height
Image Characteristics
Ray
青:物体 赤:実像(点線:虚像) 黄点:焦点 橙・緑:光路
1
Visualization
Theory & Key Formulas

$\dfrac{1}{a} + \dfrac{1}{b} = \dfrac{1}{f}$

倍率:$m = \dfrac{b}{a}$

b > 0 → 実像 b < 0 → 虚像
m < 0 → 倒立(実像) m > 0 → 正立(虚像)

💬 Deeper Learning Dialogue

🙋
Professor, when I use a magnifying glass to enlarge something, I find it strange that I can see an image even though there's no screen. Where exactly is the image?
🎓
The image you see through a magnifying glass is a "virtual image." When you place an object inside the focal length of the lens (a < f), the light rays don't actually converge, but when you look through the lens, an enlarged image appears on the extension line. It can't be projected onto a screen, but your eye's lens further converges the rays to form a real image on the retina, so you "see" it. The image appears on the same side as the object, but farther away and magnified.
🙋
Then what about a camera? The image is formed on the sensor, so that's a real image, right?
🎓
Exactly! Cameras use real images. A distant scene (a ≫ 2f) is reduced by the lens to form a real image on the sensor. For example, with a 50 mm focal length lens photographing a person 10 m away, the image distance is b = 1/(1/50 - 1/10000) ≈ 50.25 mm. The magnification is b/a ≈ 0.005, so the image is 1/200th the size of the original. This is then digitally enlarged for display.
🙋
Projectors are the opposite of cameras, right? They project film onto a large screen, so it's an enlarged real image?
🎓
Precisely! A projector uses the camera "in reverse." When you place the film between the focal length f and twice that (f < a < 2f), an enlarged real image forms on the opposite side at a far distance. In the preset "Projector" case, f=15 cm and a=18 cm (between f and 2f), so you can try it and see a greatly enlarged real image.
🙋
When you place an object at the focal point (a = f), there's "no image." Why is that?
🎓
Substituting a = f into the formula 1/a + 1/b = 1/f gives 1/b = 0, meaning b = ∞. Light from the focal point becomes parallel after passing through the lens and "meets" at infinity, but doesn't form an intersection at any finite location. This is how flashlights and searchlights work: placing the light source at the focal point sends parallel beams far away.
🙋
Is it true that concave lenses always produce only virtual images? I've heard they're used in nearsighted glasses.
🎓
Yes, no matter where you place an object, a concave lens always produces only a reduced virtual image. Nearsighted glasses use concave lenses to slightly diverge parallel light from far away. Normally, the image would form in front of the retina (causing blur), but the concave lens diverges the light, shifting the image point backward to exactly align with the retina. Interestingly, concave lenses make the incoming light appear smaller, so nearsighted people sometimes see the scenery slightly smaller when wearing glasses.

Frequently Asked Questions

What is the thin lens formula?
The formula is $\dfrac{1}{a} + \dfrac{1}{b} = \dfrac{1}{f}$. Here, a: object distance (always positive), b: image distance (positive for real image, negative for virtual image), f: focal length (positive for convex lens, negative for concave lens). Magnification is given by $m = b/a$, where |m| > 1 means enlargement, < 1 means reduction, m < 0 means an inverted image (real image), and m > 0 means an upright image (virtual image).
What is the difference between a real image and a virtual image?
A real image is formed when light rays actually converge at a point; it can be projected onto a screen, photographic film, or sensor (e.g., camera, projector). A virtual image is an "apparent image" formed by the extension of light rays; it cannot be projected onto a screen but can be seen by the eye (e.g., magnifying glass, plane mirror, concave lens). In ray diagrams, real images are shown with solid arrows, and virtual images with dashed lines.
What happens when an object is placed within the focal length?
For a convex lens, when a < f, the image distance b = af/(f-a) becomes negative. A virtual image is formed on the same side as the object (in front of the lens), upright and magnified (|m| > 1). The magnification is expressed as $m = f/(f-a)$, approaching infinity as a approaches f. This is the operating principle of a magnifying glass or loupe.
What is the difference between a camera lens and a projector lens?
In a camera, the object is placed at a > 2f (distant subject), forming a reduced real image on the sensor. In a projector, the object (film) is placed at f < a < 2f, forming an enlarged real image on the screen (at a distant position). When a = 2f, b = 2f, producing a life-size real image. This "symmetry of two 2f points" means an object between 2f and 2f forms a real image of the same size at the opposite 2f point.
How are convex and concave eyeglass lenses used differently?
For nearsightedness (myopia), the eyeball is too long, so the image forms in front of the retina. A concave lens (negative focal length) diverges light, shifting the image point backward (onto the retina). For farsightedness (hyperopia), the eyeball is too short, so the image forms behind the retina. A convex lens converges light. The lens power (diopter D) is the reciprocal of the focal length in meters: D = 1/f. For example, a myopic lens with f = −0.5 m is written as −2.0 D.

What is Lens Magnification Simulator?

Lens Magnification Simulator is a fundamental topic in engineering and applied physics. This interactive simulator lets you explore the key behaviors and relationships by directly manipulating parameters and observing real-time results.

By combining numerical computation with visual feedback, the simulator bridges the gap between abstract theory and physical intuition — making it an effective learning tool for students and a rapid-verification tool for practicing engineers.

Physical Model & Key Equations

The simulator is based on the governing equations behind Lens Magnification & Ray Tracing Simulator. Understanding these equations is key to interpreting the results correctly.

Each parameter in the equations corresponds to a slider in the control panel. Moving a slider changes the equation's solution in real time, helping you build a direct connection between mathematical expressions and physical behavior.

Real-World Applications

Engineering Design: The concepts behind Lens Magnification & Ray Tracing Simulator are applied across mechanical, structural, electrical, and fluid engineering disciplines. This tool provides a quick way to estimate design parameters and sensitivity before committing to full CAE analysis.

Education & Research: Widely used in engineering curricula to connect theory with numerical computation. Also serves as a first-pass validation tool in research settings.

CAE Workflow Integration: Before running finite element (FEM) or computational fluid dynamics (CFD) simulations, engineers use simplified models like this to establish physical scale, identify dominant parameters, and define realistic boundary conditions.

Common Misconceptions and Points of Caution

Model assumptions: The mathematical model used here relies on simplifying assumptions such as linearity, homogeneity, and isotropy. Always verify that your real system satisfies these assumptions before applying results directly to design decisions.

Units and scale: Many calculation errors arise from unit conversion mistakes or order-of-magnitude errors. Pay close attention to the units shown next to each parameter input.

Validating results: Always sanity-check simulator output against physical intuition or hand calculations. If a result seems unexpected, review your input parameters or verify with an independent method.