SnellsLaw:

Path: Imaging/Optics

% Apply the vector form of Snell's law of refraction.
 This can work with 2 or 3 dimensional rays.
 The refracted ray is in the same direction as the incoming ray.
 It returns t = [0;0;0] for total internal reflection.

 Type SnellsLaw for a demo.
------------------------------------------------------------------------
   Form:
   t = SnellsLaw( n, i, mu )
------------------------------------------------------------------------

   ------
   Inputs
   ------
   n               (3,1) Normal
   i               (3,1) Incoming ray
   mu              (1,1) n1/n2

   -------
   Outputs
   -------
   t               (3,1) Refracted ray

------------------------------------------------------------------------
   Reference: Hanrahan, P. "Refraction"
------------------------------------------------------------------------

Children:

Math: Linear/Unit

Back to the Imaging Module page