Sunlight on a sun-tracking Ø450 mm round breadboard · prism spectrum or Descartes sphere rainbow · real dispersion, 0.53° solar disk
In short: Sunlight is split into its colours in two ways: a lens and a glass prism spread it into the visible spectrum, a straight band of colours, and a single clear ball acts like one giant raindrop, throwing a real rainbow ring onto a card. The page shows how glass type, distance and stray daylight change what you see.
The sun is 9.3 mrad across, so a tracker only needs to hold a few mrad. A few mrad of error just shifts the band or arc; beyond about 10 mrad the light starts missing the optics.
White paper card, lit by the rainbow plus whatever daylight already falls on it. More daylight washes the colours toward white; shade the card (a box or a hood) for the most saturated rainbow.
Colours come from tracing rays at 31 wavelengths (400–700 nm) through the real glass, weighted by a 5778 K sun spectrum and the CIE 1931 eye response. Brightness is normalised, so a dim bow still looks visible here.
Straight rainbow (prism): the cylindrical lens squeezes the sunlight into a thin vertical line, and the prism fans each colour sideways. Colour purity depends on the glass's dispersion compared with the sun's 9.3 mrad size. With the 250 mm lens and the screen 120 mm after the prism, N-SF11 spreads 400–700 nm over 22 mm, about 10 sun-image widths, so the colours separate cleanly. N-F2 gives about 4 widths. N-BK7 and acrylic give about 1.5, so the band looks mostly white with coloured edges.
Arced rainbow (sphere): a real rainbow is a cone around the antisolar point, made by every drop. One clear sphere makes the same cone. Put a card with a hole on the sun side and you see the arc. Water gives the classic 42° bow, which is big (a 270 mm ring at 150 mm). Acrylic gives 23° and N-BK7 21°, both compact. Glasses with n ≈ 1.8 or more push the bow into the sphere's own shadow, so the cheapest sphere (a water-filled round flask, or a clear acrylic ball) is also the best one.
Safety: a lens focusing sunlight burns skin and can ignite paper. Never look along the beam or at the focus. Mount the screen before uncovering the lens.
Shows, with real glass and water dispersion, why a prism and a raindrop make rainbows, and what limits how vivid they look outdoors. It answers build questions: which prism glass separates colours, which sphere gives a visible bow, and how well the tracker must point.
1. Dispersion. Refractive index versus wavelength from the three-term Sellmeier form n² = 1 + Σ Bᵢλ²/(λ² − Cᵢ), λ in µm. Handled: closed form in rb_model.js with SCHOTT coefficients for N-BK7, N-F2, N-SF11, a PMMA fit for acrylic, and a four-term Daimon & Masumura fit for water at 20 °C. Air index fixed at n_air = 1.000278; all indices are divided by it.
2. Refraction and Fresnel transmission. Vector Snell's law d_t = η d + (η cos θᵢ − cos θ_t) N, with η = n₁/n₂ and cos θ_t = √(1 − η²(1 − cos²θᵢ)); TIR when the root is negative. Transmission T = 1 − (r_s² + r_p²)/2 with r_s = (n₁cos θᵢ − n₂cos θ_t)/(n₁cos θᵢ + n₂cos θ_t), r_p = (n₂cos θᵢ − n₁cos θ_t)/(n₂cos θᵢ + n₁cos θ_t). Handled: applied at every lens and prism surface; each ray's weight is the product of T values.
3. Prism at minimum deviation. For apex A = 60°, minimum deviation occurs at incidence i₀ = arcsin(n sin(A/2)). Handled: rotation 0 sets i₀ using n(550 nm) of the chosen glass; the slider adds a rotation (degrees). Faces are planes clipped to the 25 mm face width and height; the prism is placed so the beam axis hits the entrance-face centre. Deviation and spread are found by tracing an on-axis ray (no lens) at 400, 550 and 700 nm: spread (mm) = |δ(400) − δ(700)| × screen distance.
4. Lens imaging and the solar-disk limit. The sun subtends 0.533° (≈ 9.3 mrad), so the line focus is at least f·9.3 mrad ≈ 2.3 mm wide for f ≈ 250 mm. Handled: real thick N-BK7 plano-convex lenses (cylindrical R = 129.2 mm, t_c = 3.5 mm; spherical R = 128.8 mm, t_c = 2.8 mm; Ø25.4 mm) traced surface by surface with the shared engine's sag-surface hit routine, so chromatic aberration is included. The "distinct colour bands" readout is spread / (250 mm × 0.0093).
5. Monte Carlo spectrum on the screen. Handled: 15 × 15 jittered aperture samples inside the iris circle, 7 sun directions on the disk (Fibonacci spiral, radius 0.2665°), and 45 jittered wavelength strata over 400–700 nm per ray. Each hit on the screen plane (normal to the 550 nm central ray, at the set distance) carries XYZ weight; hits are bilinearly splatted to a 320 × 200 image and blurred by one pixel.
6. Descartes rainbow. A ray with impact parameter b = sin i refracts to r = arcsin(b/n); after k internal reflections the total deviation is D = 2(i − r) + k(π − 2r). The bow is where dD/di = 0 (light piles up). Handled: sphereProfile sweeps 40 000 impact parameters for each of 31 wavelengths (10 nm grid, 400–700 nm), k = 1 and 2. Weight per ray: ½[(1−R_s)²R_sᵏ + (1−R_p)²R_pᵏ]. Rays are binned in 0.02° bins of angle from the antisolar point, weighted by b/sin θ (per unit solid angle). The readout takes each colour's profile maximum within ±1.5° of its Descartes angle; after the 0.53° solar-disk blur and the 0.02° binning it sits about 0.2° inside the Descartes value (40.68° / 42.14° for water vs 40.87° / 42.33°). For N-SF11 (n ≈ 1.8) the bow is at 3–6°, inside the card hole, and the page says so.
7. Solar-disk blur and card projection. Handled: each angular profile is convolved with a semicircular kernel ±13 bins (±0.26°). The flat card sits at the set distance on the sun side; each pixel's angle θ is computed from the sphere centre, and irradiance is scaled by cos³ of the angle from the card normal. A hole of radius R_sphere + 3 mm shows dark.
8. Colour science. Each wavelength is weighted by a 5778 K Planck spectrum times CIE 1931 colour-matching functions (multi-lobe Gaussian fit after Wyman et al.). Handled: XYZ is white-balanced (von Kries, solar white → D65), an ambient term (fraction × peak) is added to model daylight on white paper, luminance is compressed with a Reinhard curve, then XYZ → linear sRGB, negatives clipped, over-range scaled as a whole (hue-preserving), and sRGB gamma applied.
rb_model.js: materials, Fresnel/refraction, prism and lens ray trace (tracePrism, rayPrism), screen image (prismImage), sphere profiles and card image (sphereImage), colour conversion.rb_app.js: three.js scene (ground, tripod pier, alt-az head, Ø450 mm round plate on trunnions, sun), controls, readouts; paints the simulated image onto the 3D card and draws sample ray fans (7 colours × 3 heights).engine.js supplies vector maths and the plane/sphere/cylinder surface-hit routine; kit.js and clamps.js draw mounts, clamped posts and the parts table, and re-solve clamp forks when parts slide.build.py inlines engine, kit, model and app into visible_spectrum_prism.html.rb_model.js) and check n_d for N-BK7 ≈ 1.5168.python build.py in the source folder, then open visible_spectrum_prism.html (three.js loads from the CDN).| Parameter | Value | Source |
|---|---|---|
| Sun angular diameter | 0.533° (9.3 mrad) | design choice (standard value) |
| Sun spectrum | 5778 K blackbody | design choice |
| Glass dispersion | Sellmeier N-BK7, N-F2, N-SF11 | SCHOTT datasheet |
| Water dispersion | 4-term fit, 20 °C | Daimon & Masumura 2007 |
| Air index | 1.000278 | design choice |
| Prism | 25 mm equilateral, A = 60° | design choice |
| Lens (cylindrical) | R = 129.2 mm, t_c = 3.5 mm, f ≈ 250 mm | design choice |
| Lens (spherical) | R = 128.8 mm, t_c = 2.8 mm (LA1461-type) | datasheet |
| Default iris / screen distance | Ø20 mm / 120 mm | design choice |
| Prism-mode sampling | 15 × 15 aperture, 7 sun directions, 45 λ strata | design choice |
| Sphere-mode sampling | 40 000 rays/λ, 31 λ, 0.02° bins | design choice |
| Spheres | Ø25 mm balls, Ø50 mm water flask | design choice |
| Daylight on card | 10 % (prism), 40 % (sphere) of peak | ASSUMED |
| Plate | Ø450 mm, M6 on 25 mm grid | design choice |
Every interactive page loads three shared files. engine.js is the optics math, kit.js is the three.js scene, stand-in hardware, beam drawing and parts table, and clamps.js places the posts and forks. Units are mm in a table frame (x, y, z up). Each experiment's physics lives in its own model file. The engine only does the optics that a model explicitly asks for.
make(λ).cloneB) at a beamsplitter and traces each branch with its own surface list. Surfaces have no apertures, so the model must handle clipping.The kit's photodiode and camera objects are bodies on posts and compute nothing. Photodiode voltages, quadrant read-outs, spectra and noise are all computed in each model file. These calculations are often analytic and use no engine at all, as in the Faraday, EOM and direction-finder pages. Labels are CSS2D text set by the app.
Each stand-in part and post stack registers a row: reference, category, part number, description. A stack registers a TR post, a PH40 or PH50 holder (chosen for the beam height), a BE1/M base, and a CF125C/M fork unless the post sits directly on a hole. partsTable() groups and counts identical rows, sorts them by category, and writes the HTML table and the CSV.
Each fork's M6 screw must land on a 25 mm-grid hole 26.4–49.6 mm from the post. Forks perpendicular to the beam are preferred. A sliding part keeps its hole while that hole still fits, then re-clamps. Forks may not overlap other forks, pedestals or registered footprints ("obstacles"). Conflicts turn red, and a guard stops posts from colliding. All of this is mechanical layout only; it has no optical effect.
Suggestions only; verify part numbers. Prices quoted in the README were checked online when this was built.
Two classic demonstrations: a dispersing prism (Newton) and the single-sphere (Descartes) rainbow. Colours use a solar spectrum and analytic CIE colour-matching functions.