Up to now, every cell in the grid has been vacuum. The wave speed c = 1/√(εμ) is the same everywhere, and waves propagate undisturbed.
The tinted region on the right has a higher permittivity ε. Permittivity is a measure of how strongly a material's charges respond to an electric field. When a wave enters, those charges polarize, creating their own opposing field. The net effect: the wave slows down.
The speed inside the material is c/√ε (assuming the magnetic permeability μ stays at 1, which it does for most materials). Slower speed means compressed wavefronts, with a shorter wavelength.
Part of the wave reflects at the boundary. This happens because of the impedance mismatch: the wave encounters a sudden change in how easily the medium supports it, and some energy bounces back.
The strength of the reflection depends on the contrast. When the change in ε is small, the reflection is weak. When the change is large, the reflection is strong.
When ε is 1, there is no boundary. The wave passes through unchanged. Crank it up and you'll see a strong reflected wave and heavily compressed transmission.
Anti-reflective coatings exploit this: a thin layer with intermediate ε makes the reflection from each surface interfere destructively, canceling the total reflection.
When a wave hits a boundary at an angle, the transmitted wave bends. The part of the wavefront that enters the material first slows down first, so the wavefront tilts.
The relationship between the angles is Snell's law:
sin θ1 / sin θ2 = n2 / n1
Here n = √ε is the refractive index, the factor by which the wave slows down. Higher ε means higher n, more bending.
We never coded Snell's law. The simulator enforces Maxwell's equations cell by cell, and refraction emerges on its own. This is the recurring theme: we specify local rules, and macroscopic physics follows.
A curved dielectric surface bends different parts of a wavefront by different amounts. Get the curvature right and they all converge to a focal point.
This dielectric circle acts as a lens. The plane wave refracts inward at each surface, focusing to a bright spot on the far side. Higher ε bends more, giving a shorter focal length.
Switch to Energy mode to see the energy density concentrate at the focus.
Watch as a wave enters a prism, bending on entrance and once again on exit, effectively being redirected.
With a single frequency, you get a single deflected beam. A real prism splits white light because different frequencies see slightly different ε (dispersion), so each bends by a different amount.
Look at the reflected waves too. Each surface generates its own partial reflection.