Created in China at least 2000 years ago and then in Japan, magic mirrors look like simple flat bronze mirrors with ornate designs on the back. But shine a light directly at the front of one of them, and the back’s design is projected in the reflection.

After many years of puzzling over the mirrors’ optical properties, scientists had determined by the early 20th century that the mirror surfaces are not as perfectly flat as they appear. The front surface has height variations on the scale of hundreds of nanometers that match the pattern on the back. Incoming light is reflected in different directions depending on where it strikes the relief on the surface, and the resulting brightness pattern produces the desired design in the reflected image.

The last piece of the mathematical puzzle was completed by Michael Berry of the University of Bristol in 2005. He realized that the intensity of the light in each part of the design is related to the surface-height variations. So he described the height of the mirror as a function of position on the reflecting surface. The intensity is directly related to the Laplacian of that height function, which includes the curvature. Therefore, the brightness of the light at any given part of the design is determined by the curvature between adjacent protrusions on the mirror’s surface.

Still intrigued by the subject, Berry in 2017 theorized a magic window, which instead of reflecting would refract the light into the desired design. The window’s glass would have a varying thickness that creates an effect identical to the one caused by the mirror’s surface variations. The intensity of the light in the design is described by the Laplacian, just as for the magic mirror.

Using Berry’s math and some advanced equipment, one has all the tools to make a magic mirror or window with any image. Now a team from the University of Ottawa in Canada and MIT led by Ebrahim Karimi has created a magic window that is completely flat. Instead of using varying thicknesses of glass to refract the light, the researchers’ magic window uses liquid crystals to impart optical phase shifts.