summaryrefslogtreecommitdiff
path: root/optics2abcd.m
blob: 44077cfb7c3af320882e5ba16c2edd3589b440e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function abcd = optics2abcd( optics )
% converts optics ellements to full abcd matrix
% assuming that the last position along propagation coinsides
% with the last optical element

optics = arrange_optics_along_x( optics );

abcd = [1,0; 0, 1];

d=0;
N=length(optics);
for i=1:N
    d=optics{i}.x - d; % distance between optical elements
    abcd= optics{i}.abcd * abcd_free_space(d) * abcd;
end

end