Near field — Huygens wavelet interferenceFar field — array factor |F(θ)|
Incident wave Metasurface elements (hue = phase) Ordinary refraction (reference) Grating lobe (m ≠ 0)

Metasurface Phased Array — Grating Lobes vs Generalized Snell's Law

The 3D version of this simulator draws the metasurface's anomalous beam as a single Fermat-principle ray. This 2D counterpart computes it from scratch a different way: every meta-atom is a genuine Huygens point source, and the near-field panel sums all of their cylindrical wavelets pixel by pixel, so the steered beam you see is real constructive interference, not a scripted arrow. The far-field strip goes further, evaluating the exact closed-form array factor of a uniform phased array and revealing something the ray picture can't show at all — grating lobes, spurious extra beams that appear whenever the element pitch isn't small compared to the wavelength. Tune the pitch toward one wavelength to watch a second, unwanted beam peel away from the intended one, exactly the sampling trade-off real metasurface designers have to manage.