Benjamin Crowell · Simple Nature Ch. 9 · CC BY-SA 3.0
Light reflects, refracts, diffracts, and interferes. Snell's law governs refraction. Lenses form images by bending light. Diffraction and interference reveal the wave nature of light.
Reflection
The law of reflection: the angle of incidence equals the angle of reflection, both measured from the normal to the surface. This is the simplest optical law and follows from Fermat's principle: light takes the path of least time.
Scheme
; Law of reflection: angle_in = angle_out; Both measured from the normal.; A mirror reverses left-right (really front-back).
(define pi 3.14159265)
(define (degrees->radians deg) (* deg (/ pi 180)))
(define (radians->degrees rad) (* rad (/ 180 pi)))
; Reflection simply returns the same angle
(define (reflect angle-in)
angle-in)
(display "Incident angle: 30 deg") (newline)
(display "Reflected angle: ")
(display (reflect 30))
(display " deg") (newline)
(display "Incident angle: 45 deg") (newline)
(display "Reflected angle: ")
(display (reflect 45))
(display " deg") (newline)
; At normal incidence (0 deg), light bounces straight back
(display "Normal incidence reflects at: ")
(display (reflect 0))
(display " deg")
Refraction and Snell's law
When light crosses a boundary between two media, it bends. Snell's law: n1 * sin(theta1) = n2 * sin(theta2), where n is the index of refraction (n = c/v). Light bends toward the normal when entering a denser medium. Beyond the critical angle, light reflects totally: this is how fiber optics and diamonds work.
Scheme
; Snell's law: n1 * sin(theta1) = n2 * sin(theta2); theta2 = arcsin(n1/n2 * sin(theta1))
(define pi 3.14159265)
(define (deg->rad d) (* d (/ pi 180)))
(define (rad->deg r) (* r (/ 180 pi)))
(define (snell n1 theta1-deg n2)
(let* ((theta1 (deg->rad theta1-deg))
(sin-theta2 (* (/ n1 n2) (sin theta1))))
(if (> sin-theta2 1)
"total internal reflection"
(rad->deg (asin sin-theta2)))))
; Air (n=1) to glass (n=1.5)
(display "Air to glass at 30 deg: ")
(display (snell 1.0301.5))
(display " deg") (newline)
(display "Air to glass at 45 deg: ")
(display (snell 1.0451.5))
(display " deg") (newline)
; Glass to air: critical angle
(display "Glass to air at 30 deg: ")
(display (snell 1.5301.0))
(display " deg") (newline)
(display "Glass to air at 45 deg: ")
(display (snell 1.5451.0)) (newline)
; Critical angle: sin(theta_c) = n2/n1
(define theta-c (rad->deg (asin (/ 1.01.5))))
(display "Critical angle (glass to air): ")
(display theta-c) (display " deg")
Python
importmathdef snell(n1, theta1_deg, n2):
theta1 = math.radians(theta1_deg)
sin_t2 = (n1/n2) * math.sin(theta1)
if sin_t2 > 1:
return"total internal reflection"returnmath.degrees(math.asin(sin_t2))
print(f"Air to glass at 30 deg: {snell(1.0, 30, 1.5):.2f} deg")
print(f"Air to glass at 45 deg: {snell(1.0, 45, 1.5):.2f} deg")
print(f"Glass to air at 30 deg: {snell(1.5, 30, 1.0):.2f} deg")
print(f"Glass to air at 45 deg: {snell(1.5, 45, 1.0)}")
print(f"Critical angle: {math.degrees(math.asin(1/1.5)):.2f} deg")
Lenses
A lens uses refraction at two curved surfaces to bend light. The thin lens equation: 1/f = 1/d_o + 1/d_i, where f is the focal length, d_o is the object distance, and d_i is the image distance. Positive d_i means a real image (on the other side); negative means virtual (same side as object).
Scheme
; Thin lens equation: 1/f = 1/do + 1/di; Solve for di: di = f*do / (do - f); Magnification: m = -di/do
(define (image-distance f do)
(/ (* f do) (- do f)))
(define (magnification f do)
(let ((di (image-distance f do)))
(/ (* -1 di) do)))
; f = 10 cm converging lens
(define f 10)
; Object at various distances
(define distances (list 302015105))
(define (show-image do)
(if (= do f)
(begin (display " do=") (display do)
(display " cm -> image at infinity") (newline))
(let ((di (image-distance f do))
(m (magnification f do)))
(display " do=") (display do)
(display " cm -> di=") (display di)
(display " cm, mag=") (display m) (newline))))
(display "f = 10 cm lens:") (newline)
(for-each show-image distances)
; Negative di = virtual image (same side as object); |m| > 1 = magnified, |m| < 1 = reduced
Diffraction and interference
Waves bend around obstacles (diffraction) and combine constructively or destructively (interference). For a double slit with spacing d, bright fringes appear where d * sin(theta) = m * lambda, with m = 0, 1, 2, ... This pattern proved that light is a wave. Single-slit diffraction produces a central maximum with weaker side lobes.
Scheme
; Double-slit interference: d*sin(theta) = m*lambda; Bright fringe angles for various orders m
(define pi 3.14159265)
(define (rad->deg r) (* r (/ 180 pi)))
(define (fringe-angle d lambda m)
(let ((sin-theta (/ (* m lambda) d)))
(if (> (abs sin-theta) 1)
#f
(rad->deg (asin sin-theta)))))
; Green laser (532 nm) through slits 0.1 mm apart
(define lambda 532e-9) ; meters
(define d 0.1e-3) ; meters
(display "Double slit: d=0.1 mm, lambda=532 nm") (newline)
(display "Fringe angles:") (newline)
(define (show-fringe m)
(let ((angle (fringe-angle d lambda m)))
(if angle
(begin (display " m=") (display m)
(display ": theta = ") (display angle)
(display " deg") (newline))
(begin (display " m=") (display m)
(display ": no fringe (sin > 1)") (newline)))))
(for-each show-fringe (list 012345))
The thin lens equation assumes a thin lens (thickness much less than focal length) and paraxial rays (close to the optical axis). Real lenses have aberrations. The double-slit formula assumes far-field (Fraunhofer) diffraction, where the screen is far from the slits. Crowell develops near-field (Fresnel) diffraction as well. Our Scheme code computes fringe angles but not the full intensity pattern, which requires summing phasors.