aboutsummaryrefslogtreecommitdiff
path: root/optics2abcd.m
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2013-09-27 15:39:13 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2013-09-27 15:39:13 -0400
commit21ad89349d9f799ff6dfb9828d915797dd964e07 (patch)
tree1216277a871cd8110632ffcf5d6d0d5fa5cc61b0 /optics2abcd.m
parent52597cba7c3e12336151e2023a41f2758edb866a (diff)
downloadmode_match-21ad89349d9f799ff6dfb9828d915797dd964e07.tar.gz
mode_match-21ad89349d9f799ff6dfb9828d915797dd964e07.zip
added optics to abcd conversion
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