Docs / Light & colour
What is light? How does a prism create a rainbow? To use an optics simulator effectively, we first need to understand the physical nature of light and how it interacts with the matter it passes through.
Light is an electromagnetic wave—oscillating electric and magnetic fields traveling through space. The distance between the peaks of these waves is called the wavelength.
The human eye is only sensitive to a very narrow band of electromagnetic waves, roughly between 380 nanometers (nm) and 780 nm. We call this narrow band the visible spectrum. Other parts of the electromagnetic spectrum include radio waves, microwaves, infrared, ultraviolet, X-rays, and gamma rays.
When light enters our eyes, specialized cells called cones detect it. We have three types of cones, roughly sensitive to red, green, and blue light. Our brain interprets the combination of signals from these cones as colour.
"White" light, like sunlight or the light from a typical LED bulb, isn't a single wavelength. It is a mixture of many different wavelengths (colours) combined together.
Light travels in a vacuum at exactly c (approx. 300,000 km/s). But when light enters a dense transparent material, like water or glass, it slows down. This slowing down is quantified by the material's refractive index (n).
When a ray of light hits the boundary between two materials (like air and glass) at an angle, the change in speed causes the ray to bend. This bending is called refraction. The exact angle of bending is described by Snell's Law.
Where n₁, n₂ are the refractive indices of the two materials, and θ₁, θ₂ are the angles the light ray makes with the normal (a line perpendicular to the surface).
Here is where optics gets really interesting: the refractive index of a material isn't just one fixed number. It actually varies slightly depending on the wavelength of the light!
In general, glass bends blue light (shorter wavelengths) slightly more than it bends red light (longer wavelengths). This wavelength-dependent bending is called dispersion.
Because of dispersion, when a beam of white light enters a glass prism at an angle, the different colours bend by different amounts. The red light bends the least, and the violet light bends the most. This causes the beam to fan out into a rainbow spectrum—a phenomenon famously demonstrated by Isaac Newton.
When light travels from a dense material (like glass) back into a less dense material (like air), it bends away from the normal. If the incident angle inside the glass is steep enough, the calculated exit angle reaches 90° (running parallel to the surface).
Any angle steeper than this critical angle cannot exit the glass at all. Instead, 100% of the light bounces back inside. This is called Total Internal Reflection (TIR).
TIR is the magical principle behind fiber optic cables, which trap light inside a flexible glass core, allowing data to travel across oceans without leaking out.
Here is a quick look at the refractive indices (measured at the green 587.6 nm wavelength, known as nd) of some common materials you'll find in Photonica's material library:
| Material | Refractive Index (nᵈ) | Abbe Number (Vᵈ) |
|---|---|---|
| Vacuum | 1.0000 | Infinite |
| Air | 1.0003 | ~89 |
| Water | 1.333 | 55.3 |
| N-BK7 (Crown Glass) | 1.5168 | 64.17 |
| SF11 (Dense Flint Glass) | 1.7847 | 25.76 |
| Diamond | 2.417 | 55.3 |