Presets
Playback
Things to try
- Water into air: raise the angle past 48.8 degrees; the beam stops leaving the tank.
- Slide n2 up: the beam bends toward the vertical.
- On the lens, drag u through f: the image flips from real to virtual.
- Take Fat lens and widen the aperture: the red spot spreads (spherical aberration).
Experiment
Refraction
Lens
Camera
Layers
Quality
Model check
The science
What is modelled
Two geometric-optics experiments with real 3D vector ray tracing. Light is treated as rays (wavelength much smaller than every object). Rays are traced in three dimensions even though the refraction experiment lies in one plane.
Snell's law and total internal reflection
n1 sinθ1 = n2 sinθ2. If n1 > n2 there is a critical angle θc = arcsin(n2/n1) beyond which no refracted ray exists. In vector form the refracted direction is t = η d + (η cosθi − √(1 − η²(1 − cos²θi))) n with η = n1/n2; the radicand going negative is total internal reflection.
Fresnel reflectance
For unpolarised light the reflected fraction is the mean of the s and p parts, Rs = ((n1cosθi − n2cosθt)/(n1cosθi + n2cosθt))² and Rp = ((n1cosθt − n2cosθi)/(n1cosθt + n2cosθi))²; at normal incidence R = ((n1−n2)/(n1+n2))², and Rp = 0 at the Brewster angle arctan(n2/n1). Beam brightness in the 3D view follows R and T = 1 − R (absorption neglected).
The lens
Two spherical surfaces (radii R1, R2, sign: positive centre to the right) separated by thickness d. Every ray is intersected with the exact spheres and refracted by the vector law, so spherical aberration appears by itself. The thin-lens formulas 1/f = (n − 1)(1/R1 − 1/R2) and 1/f = 1/u + 1/v are paraxial approximations; the page also computes the thick-lens ABCD ray matrix M = S2 T(d/n) S1, whose elements give f = −1/C and, from the imaging condition B = 0, the image distance.
Checks on the page
1) Critical angle found by bisection on the traced refraction and Brewster angle found by scanning Rp. 2) Normal-incidence reflectance and R + T = 1. 3) Paraxial focus from a ray traced through both spheres against the ABCD back focal distance. 4) Image distance from two traced near-axis rays against B = 0 in the matrix.
Honest simplifications
No dispersion (one index per medium; a real prism or rainbow needs n to vary with wavelength), no absorption, no diffraction at the aperture, no coatings, no stray light. The spot diagram shows only geometric blur. Indices are typical values (air 1.000, water about 1.33, crown glass about 1.5, diamond about 2.42 for visible light), not exact constants.