function F = sysmatrix(cv,th,rn) %SYSMATRIX % % F = SYSMATRIX(CV,TH,RN) % % Returns the 2 x 2 paraxial system matrix given % % CV curvatures % TH distance to following surface % RN refractive index of following medium % % first surface is a dummy to give index of incident medium % m = length(th); if (nargin==2) phi = cv; td = th; else phi(1) = 0; td(1) = th(1)/rn(1); for (i=2:m) phi(i) = (rn(i)-rn(i-1))*cv(i); td(i) = th(i)/rn(i); end end F = eye(2,2); for (i=1:m) F = F * [ 1 -phi(i); 0 1 ] * [ 1 0; td(i) 1]; end
>> th=[0 3.0486 5.4981 1.0162 0.6215 4.6129 3.0486 0 ]; >> rn=[1 1.713 1 1.689 1 1 1.713 1]; >> cv=[0 0.0458621 0.0039265 -0.0301655 0.0454845 0 0.0104227 -0.0406946]; >> >> f = sysmatrix(cv,th,rn) f = 0.8285 -0.0200 17.6707 0.7806
function d = conjugates(m,f) % CONJUGATES(M,F) % % calculates object/image conjugates given the % system matrix and magnification % % D = CONJUGATES(M,F) % % where D(1) = object distance (object to system) % D(2) = image distance (system to image) % M = magnification % F = 2 x 2 optical system matrix % Author: John Loomis, 1 Oct 1997 d = [ (1/m - f(2,2))/f(1,2) (m - f(1,1))/f(1,2) ];
>> bfd = conjugates(0,f) Warning: Divide by zero. bfd = -Inf 41.4387 >> pp = conjugates(1,f) pp = -10.9727 -8.5803 >> efl = bfd - pp efl = -Inf 50.0190 >> hiatus = sum(th) + sum(pp) hiatus = -1.7070
function [z,y] = drawlens(ap,th,cv,zstart) % % DRAWLENS(AP,TH,CV) % % if (nargin<4) zstart = 0; end u = linspace(-ap,ap,60); z = [ sag(u,cv(1)) th+sag(-u,cv(2)) sag(-ap,cv(1)) ] + zstart; y = [ u -u -ap ]; if (nargout==0) plot(z,y) end
drawlens(9,th(2),cv(2:3)); hold drawlens(7.5,th(4),cv(4:5),sum(th(1:3))); drawlens(9,th(7),cv(7:8),sum(th(1:6))); axis([-1 19 -10 10]); axis equal axis square hold off
Maintained by John Loomis, last updated 2 Oct 1997