Mirror
Reflects rays with configurable size and reflectivity.
Open in the canvas →In the real world
Reflection at a smooth interface follows the law of reflection: the angle of incidence equals the angle of reflection, both measured from the surface normal, with the incident and reflected rays in the same plane. In vector form, an incident direction d̂ reflecting off a surface with unit normal n̂ becomes:
In OpticalSetup
OpticalSetup implements the exact vector law of reflection shown above — the mirror surface's normal is computed from its two drawn endpoints, so rotating or resizing a mirror changes the reflected direction correctly at any angle. Reflectivity is a single configurable percentage: at 100% every ray reflects; below that, each incident ray splits into a reflected branch carrying fraction R of the intensity and a transmitted branch carrying 1 − R, which is how a partially-reflective cavity mirror or output coupler is modeled.
Reflectivity is a single flat number: real coatings vary with angle of incidence and polarization (s- vs p-plane), and a metal mirror's reflectance varies with wavelength. None of that is modeled — R is constant regardless of incidence angle, polarization, or color.