summaryrefslogtreecommitdiff
path: root/optics2abcd.m
diff options
context:
space:
mode:
Diffstat (limited to 'optics2abcd.m')
-rw-r--r--optics2abcd.m17
1 files changed, 17 insertions, 0 deletions
diff --git a/optics2abcd.m b/optics2abcd.m
new file mode 100644
index 0000000..44077cf
--- /dev/null
+++ b/optics2abcd.m
@@ -0,0 +1,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