Ray tracing (physics)

In physics, ray tracing is a method for calculating the path of waves or particles through a system with regions of varying propagation velocity, absorption characteristics, and reflecting surfaces. Under these circumstances, wavefronts may bend, change direction, or reflect off surfaces, complicating analysis.

Historically, ray tracing involved analytic solutions to the ray's trajectories. In modern applied physics and engineering physics, the term also encompasses numerical solutions to the Eikonal equation. For example, ray-marching involves repeatedly advancing idealized narrow beams called rays through the medium by discrete amounts. Simple problems can be analyzed by propagating a few rays using simple mathematics. More detailed analysis can be performed by using a computer to propagate many rays.

When applied to problems of electromagnetic radiation, ray tracing often relies on approximate solutions to Maxwell's equations such as geometric optics, that are valid as long as the light waves propagate through and around objects whose dimensions are much greater than the light's wavelength. Ray theory can describe interference by accumulating the phase during ray tracing (e.g., complex-valued Fresnel coefficients and Jones calculus). It can also be extended to describe edge diffraction, with modifications such as the geometric theory of diffraction, which enables tracing diffracted rays. More complicated phenomena require methods such as physical optics or wave theory.