{
} program pivot; const fsd=4;{field dize decimals} fsr=1;{field size real} n=1.5;{refractive index} r=6;{mm radius of convex surface} t=2.75;{mm center thickness of lens} delta=0.0001;{mm position step} print_angle=false;{print arrival angle, mrad} print_dp=false;{print pivot to lens distance, um} ro=50.0;{mm range from aperture to object} var a,b,c,d,e:real;{rad angles} q,s,v:real;{mm distances} p:real;{mm distance from aperture to back of lens} dp:real;{mm distance from pivot point to back of lens} error:real;{mm from circle} ho:real;{object height} i,j:integer; function tan(x:real):real;begin tan:=sin(x)/cos(x); end; begin for i:=-15 to 15 do begin if i<>0 then begin a:=i/100; write(a*1000:fsr:fsd,' '); for j:=0 to 10 do begin p:=j/5; b:=arcsin(sin(a)/n); q:=p*tan(a); v:=t+delta/2; repeat v:=v-delta/2; s:=q+v*tan(b); error:=sqrt(sqr(r-t+v)+sqr(s)) - r; until abs(error) < delta; c:=arcsin(s/r); d:=b-c; e:=arcsin(n*sin(d)); dp:=s/tan(c+e)-v; ho:=(ro-p+dp)*tan(e+c); if print_angle then write(1000*(e+c):fsr:fsd,' ') else if print_dp then write(1000*dp:fsr:fsd,' ') else write(ho:fsr:fsd,' '); end; writeln; end; end; end.