Path: Imaging/Optics

% Computes the ray transfer matrix for an optical system.

   Optical element types  Relevant data structure elements
   type                   d   n1   n2   r    f
   ---------------------  --------------------
   'free space'           X
   'flat interface'           X    X
   'curved interface'         X    X    X
   'flat mirror'
   'curved mirror'                      X
   'thin lens'                               X

    In the data structure R is + for concave lenses. f is + for converging
    lenses. You can ignore elements that are not relevant to your element.
    d(1) is the first optical element (nearest to the image)
    d(2) is the next element encountered, etc.

    Your data structure need only contain elements that you wish to use.
    However every data structure must be the same. For example, to use
    just thin lens and distances d(k) = struct('type', 'thin lens', 'f', 10, 'd', 0);

    The distance from the optical axis is the distance on entry to the 
    optical system, i.e. at the first element.

    Type RayTransferMatrix for a zoom lens demo. This is a simple 4 lens
    system. We only move the diverging lens.

   [m, xT] = RayTransferMatrix( d, x )

   d             (1,1)   Optical system elements
                         .type (1,:) Type of lens
                         .d    (1,1) Distance
                         .n1   (1,1) Initial refractive index
                         .n2   (1,1) Final refractive index
                         .r    (1,1) Radius of curvature
                         .f    (1,1) Focal length
   x             (2,:)   Rays [distance from optical axis;angle]

   m             (2,2)   Transfer matrix
   xT            (2,:)   Rays [distance from optical axis;angle]



Common: Graphics/Plot2D

Back to the Imaging Module page