›Prism Refraction Simulator Back
Optics

Prism Refraction Simulator

Change the angle of incidence, the prism apex angle and the glass to visualise refraction, dispersion and total internal reflection in real time, and understand Snell's law, the deviation angle and how rainbows form.

Glass type

Refractive index n
Prism apex angle A
°
Incident angle θ₁
°
Live Values
Incident angle θ₁
—
Refraction angle θ₂
—
Deviation δ
—
Minimum deviation δmin
—
Critical angle θc
—
Refractive index n
—
Real-Time Ray Tracing
Red (long wavelength, low n) Violet (short wavelength, high n) Reference line for deviation
Theory & Key Formulas
\(n_1\sin\theta_1 = n_2\sin\theta_2\)
Deviation: \(\delta = \theta_1 + \theta_4 - A\)
Critical angle: \(\theta_c = \arcsin(1/n)\)
Minimum deviation: \(\delta_{min} = 2\arcsin(n\sin\frac{A}{2}) - A\)

💬 Explanation Dialogue

🙋
Why does a prism split light into rainbow colours? Are the colours already inside white light?
🎓
White light contains every visible wavelength (400–700 nm). The refractive index of glass differs slightly from wavelength to wavelength (dispersion): violet is bent the most and red the least, so the exit angles spread out and you see a rainbow. Newton demonstrated this experimentally. In this tool, "Show spectral dispersion" draws six rays from red 660 nm to violet 440 nm, each with its own refractive index; for crown glass, a 60° apex and 45° incidence, the red and violet exit directions differ by about 1.2°.
🙋
What is "total internal reflection"? I heard it's used in optical fibres.
🎓
When light travels from a denser medium to a less dense one — glass to air, for example — and the angle of incidence reaches the critical angle, all of the light is reflected and none is transmitted. An optical fibre uses this total internal reflection to guide light along the glass. A diamond's sparkle works the same way: with n = 2.42 the critical angle is only about 24°, so a brilliant cut is angled so that light entering the stone is totally reflected twice at the pavilion and returns to the front. Choose "Diamond" in this tool and you can check that with a 60° apex the light is totally reflected at the second face at every angle of incidence and never emerges.
🙋
What is "minimum deviation"? Is there anything special about that condition?
🎓
At minimum deviation (angle of incidence = angle of emergence) the light passes through the prism symmetrically. The deviation is then insensitive to the angle of incidence, so measurement precision is highest. This condition is used for calibrating spectrometers and for precise refractive-index measurements. For crown glass (n = 1.52) and a 60° apex the minimum deviation is 38.9°, reached at an incidence of about 49.5°. Try to find the incidence angle at which the "Min. deviation" label appears in the figure.

FAQ

Q. Why is red refracted less than blue?
A. The electrons in glass respond to the light's electric field, and the closer the frequency is to the ultraviolet (shorter wavelength) the more strongly they respond, so the polarisation (permittivity) and hence the refractive index are larger (normal dispersion). Across the visible range it falls steadily from violet (n ≈ 1.53) to red (n ≈ 1.51).
Q. How does a rainbow in the sky form?
A. Raindrops act as spherical prisms. Light follows the path enter → one internal reflection → exit, and the angle measured from the direction opposite the sun concentrates at about 42° (red) to 40° (violet), so the rainbow is seen in that direction. This concentration, which corresponds to minimum deviation, is why the bow is bright.
Q. Why does a diamond sparkle?
A. Diamond has a very high refractive index, n ≈ 2.42, so its critical angle is small, about 24°. The gem cut (brilliant cut) is calculated so that light is repeatedly totally reflected inside and concentrated towards the front. Its high dispersion (spread of colours) also produces "fire", the rainbow-coloured flashes.
Q. What is the numerical aperture (NA) of an optical fibre?
A. NA = √(n_core² − n_clad²) gives the maximum angle of light that the fibre can accept (acceptance angle = arcsin(NA)). The larger the index difference between core and cladding, the higher the NA and the wider the range of angles accepted. Typical values are NA ≈ 0.1 for single-mode fibre and NA ≈ 0.2–0.5 for multimode fibre.

What Is the Prism Refraction Simulator?

Refraction of light inside a prism follows Snell's law \( n_1 \sin\theta_1 = n_2 \sin\theta_2 \), which fixes the angles of incidence and refraction at each interface. For a prism of apex angle \( A \) and refractive index \( n \), the minimum deviation \( \delta_m \) is given by \( \delta_m = 2\sin^{-1}\left(n \sin\frac{A}{2}\right) - A \), and the difference in refractive index between wavelengths produces dispersion. In visible light, for example, blue is bent more than red and a rainbow spectrum forms. When the angle of incidence at the second face exceeds the critical angle \( \theta_c = \sin^{-1}(1/n) \), total internal reflection occurs and the light is reflected instead of leaving through the second face (this tool also draws the path after reflection). The simulator lets you change these parameters in real time and observe the refracted path and the dispersion intuitively.

Real-World Applications

Early-stage optical design
In spectrometers and camera lenses, the glass (refractive index and dispersion) and the geometry decide how light bends and how the colours separate. Switching the "Glass type" and watching the deviation and dispersion change builds that first intuition. Chromatic aberration is corrected by combining a low-dispersion crown glass with a high-dispersion flint glass; the Abbe number in the table below is the indicator. In an optical fibre only light at angles shallower than the critical angle set by the core–cladding index difference is trapped by total internal reflection, so the critical-angle readout is the direct starting point for design.

Research and education
In university physics laboratories and optics lectures it serves as teaching material for an intuitive grasp of Snell's law and dispersion. When learning how a rainbow forms, for example, the refraction and total internal reflection inside a water droplet can be reproduced with the prism model, and the change of deviation with angle of incidence and wavelength observed in real time. Students can thus acquire, by their own trial and error, concepts such as wavelength dependence and the critical angle that are hard to grasp from the formulas alone.

Relation to CAE and its place in practice
This simulator is for quickly checking the effect of angle of incidence, apex angle and refractive index in the early study of an optical system. It suits getting a rough picture of how the prism geometry matters before doing precise ray tracing in optical design software such as Zemax or Code V. The aberrations and tolerances of a complete lens are evaluated with such dedicated software.

Common Misconceptions and Points to Note

It is tempting to think that "the larger the angle of incidence, the longer the path inside the prism and the stronger the dispersion (colour separation)", but in fact the difference between the red and violet exit directions is set almost entirely by the glass's dispersion (the change of refractive index with wavelength) and the apex angle, and depends only weakly on the angle of incidence. Conversely, if the angle of incidence is made too small, the angle of incidence at the second face exceeds the critical angle, total internal reflection occurs and the light no longer leaves the prism (below 30° incidence for crown glass with a 60° apex).

It is tempting to think that "a larger apex angle always spreads the rainbow spectrum wider", but in fact the larger the apex angle, the more easily total internal reflection occurs at the second face, and once the apex angle exceeds twice the critical angle (about 82° for crown glass) no light is transmitted at any angle of incidence. Even at an 80° apex, transmission is only possible for incidence angles of 73° or more, and near that limit only the violet side, with its larger refractive index, is totally reflected first. Take care with the combination of apex angle and angle of incidence in the simulation.

It is tempting to think that "whatever the glass, a higher refractive index always means a larger deviation (bending angle)", but in fact the deviation is determined by all three: angle of incidence, apex angle and refractive index. At the same 45° incidence and 60° apex, n = 1.52 gives a deviation of 39.3° and n = 1.62 gives 50.3°, but n = 2.42 (diamond) is totally reflected at the second face and nothing emerges. The deviation changes gently with the angle of incidence around minimum deviation and sharply near the total-internal-reflection limit, so take care when fine-tuning design values in practice.

How to Use

  1. Set the refractive index with the "Glass type" buttons or the "Refractive index n" control (1.10–2.80 in steps of 0.01). Common optical glasses lie between 1.5 and 1.9
  2. Change the "Prism apex angle A" from 20° to 80°; the deviation δ and the minimum deviation δmin update immediately
  3. Adjust the "Incident angle θ₁" from 0° to 89° and check the refraction angle θ₂ at the first face and whether total internal reflection occurs at the second face. "Sweep incident angle" varies it automatically
  4. Turn on "Show spectral dispersion" to draw six rays from red (660 nm) to violet (440 nm), each with its own refractive index, and see how the colours separate
  5. Turn on "Show surface normals" to display the normals from which the angles of incidence and refraction are measured

Worked Example

Crown glass (n = 1.52), apex angle 60°, angle of incidence 45°: the refraction angle at the first face follows from sin θ₂ = sin 45°/1.52 ≈ 0.465, so θ₂ = 27.7°. The angle of incidence at the second face is 60° − 27.7° = 32.3°, smaller than the critical angle θc = asin(1/1.52) = 41.1°, so the light is transmitted; the exit angle is asin(1.52·sin 32.3°) ≈ 54.3° and the deviation δ = 45° + 54.3° − 60° = 39.3°. The minimum deviation is 2·asin(1.52·sin 30°) − 60° = 38.9° (at an incidence of about 49.5°). With dispersion shown, the tool's dispersion model gives deviations for red (660 nm, n ≈ 1.518) and violet (440 nm, n ≈ 1.530) that differ by about 1.2°. Below 30° incidence, total internal reflection occurs at the second face.

Practical Notes

🎬 Watch it in motion

Total Internal Reflection | How Fiber Traps Light #Shorts
Total Internal Reflection | How Fiber Traps Light #Shorts
Refraction | past the critical angle, light can't escape #Shorts
Refraction | past the critical angle, light can't escape #Shorts
Dispersion | a prism splits white light into a rainbow #Shorts
Dispersion | a prism splits white light into a rainbow #Shorts
Reference Data

📊 Representative Glass Dispersion Data (sodium D line, λ = 589 nm)

MaterialRefractive Index n_DAbbe Number VTypical Use
Crown Glass1.5264Front lens groups, eyeglasses
Flint Glass1.6236Chromatic aberration correction, rear groups
BK7 Optical Glass1.51764.2Standard precision optics
Dense Flint Glass (SF)1.7528Periscopes and special-purpose optics
Fused Silica (SiO₂)1.45868UV optics and optical fiber
Water (20°C)1.33356Natural and underwater optics
Diamond2.41755Gemstones and high-pressure optical windows
Abbe number V = (n_D − 1)/(n_F − n_C). Larger V means lower dispersion and less chromatic aberration.