trig1b demo

Contents

define optical system

cv = [ 0 1/29.96 -1/183.63 0];
th = [ 0 1 48.8627 0];
rn = [ 1 1.5168 1 1 ];

trace ray through edge of pupil

y =  linspace(0,1,6)';
ye = trig_ray(y*6.25, 0, cv, th, rn);
[y ye]
ans =

            0            0
          0.2     0.011474
          0.4     0.018191
          0.6     0.015242
          0.8   -0.0026077
            1    -0.041102

y = linspace(-1,1,101)';
ye = trig_ray(y*6.25,0,cv,th,rn);
plot(y,ye);
xlabel('relative aperture');
ylabel('transverse ray error');

fit wavefront

lambda = 0.00058756;
ua = -0.125;
epsilon = abs(lambda/ua);

d = - ye/epsilon;
c = [ 2*y 4*y.^3 6*y.^5 ];

a = c\d
a =

      -6.5197
       5.2205
      0.15005

calculate rms deviation from fit

diff = d - c*a;
rms = sqrt(sum(diff.*diff)/length(diff))
rms =

   0.00041836