diff options
-rw-r--r-- | abcd.m | 2 | ||||
-rw-r--r-- | gbeam_propagation.m | 2 | ||||
-rw-r--r-- | gbeam_propagation_froward_only.m | 6 |
3 files changed, 5 insertions, 5 deletions
@@ -6,7 +6,7 @@ function lens_abcd =abcd_lens(focal_distance) lens_abcd = [1, 0; -1/focal_distance, 1]; endfunction -function qnew=q_after_element(q_old,abcd) +function qnew=q_after_abcd(q_old,abcd) qnew=(q_old*abcd(1,1)+abcd(1,2))/(q_old*abcd(2,1)+abcd(2,2)); endfunction diff --git a/gbeam_propagation.m b/gbeam_propagation.m index 53f9173..2831880 100644 --- a/gbeam_propagation.m +++ b/gbeam_propagation.m @@ -30,7 +30,7 @@ function q = gbeam_propagation(x_pos, q_in, x_in, optics_elements) % with x_in i.e it is 0 in backwards x coordinates (or at index 1) then % we need to apply abcd matrix of that element in advance. if ( optics_elements_backw{i}.x == 0) - q_in_backw(1) = q_after_element( q_in_backw(1), optics_elements_backw{i}.abcd); + q_in_backw(1) = q_after_abcd( q_in_backw(1), optics_elements_backw{i}.abcd); end end diff --git a/gbeam_propagation_froward_only.m b/gbeam_propagation_froward_only.m index 91cca20..5c7ea3a 100644 --- a/gbeam_propagation_froward_only.m +++ b/gbeam_propagation_froward_only.m @@ -28,14 +28,14 @@ function q = gbeam_propagation_froward_only(x_pos, q_in, x_in, optics_elements) el=optics_elements{k}; if ( (x_last_calc < el.x) && (el.x <= x_pos_i) ) abcd=abcd_free_space(el.x-x_last_calc); - q_last_calc=q_after_element(q_last_calc,abcd); - q_last_calc=q_after_element(q_last_calc,el.abcd); + q_last_calc=q_after_abcd(q_last_calc,abcd); + q_last_calc=q_after_abcd(q_last_calc,el.abcd); x_last_calc=el.x; endif endfor if (x_pos_i > x_last_calc); abcd=abcd_free_space(x_pos_i-x_last_calc); - q_last_calc=q_after_element(q_last_calc,abcd); + q_last_calc=q_after_abcd(q_last_calc,abcd); x_last_calc=x_pos_i; endif q(i)=q_last_calc; |