diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2012-11-16 15:13:31 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2012-11-16 15:13:31 -0500 |
commit | 61b45d21c5cd28038e762bf1aa96a73852e14bfd (patch) | |
tree | ff114eda395200b679d5b4df9cf5542b73d5e76f /example_beam_trace_diamond.m | |
parent | f3adbd5a38729286adbaabf455bcf0d3582591b0 (diff) | |
download | wgmr-61b45d21c5cd28038e762bf1aa96a73852e14bfd.tar.gz wgmr-61b45d21c5cd28038e762bf1aa96a73852e14bfd.zip |
example with diamond prism
Diffstat (limited to 'example_beam_trace_diamond.m')
-rw-r--r-- | example_beam_trace_diamond.m | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/example_beam_trace_diamond.m b/example_beam_trace_diamond.m new file mode 100644 index 0000000..e3cc30d --- /dev/null +++ b/example_beam_trace_diamond.m @@ -0,0 +1,76 @@ +%beam1.k=[-1,0]; +%beam1.origin=[2,0.5]; +beam_initial_travel_angle=(70+30-180)/180*pi; +beam1.k=[cos(beam_initial_travel_angle), sin(beam_initial_travel_angle)]; +beam1.origin=[0.5,2]; +%beam1.k=[-1,-1]; +%beam1.origin=[2,2]; +beam1.face=NA; +beam1.intensity = 1; +beam1.polarization = 1; % 1 for s and 2 for p +beam1.status='incoming'; % could be reflected, refracted, incoming + +beam2=beam1; +beam1.polarization = 2; % 1 for s and 2 for p + +beams={beam1,beam2}; + +n_rutile=[2.7532, 2.4885]; % n_s and n_p +n_diamond=[2.4 , 2.4 ]; % n_s and n_p +n_disk= [1.3751, 1.3868]; % MgF2 book value +n_disk= [1.465 , 1.465 ]; % MgF2 measured +n_disk= [1.39 , 1.39 ]; % CaF2 measured for p-polarization +n_air= [1., 1.]; + +face1.vertex1=[-1,0]; +face1.vertex2=[1,0]; +%face1.n_right = n_air; +face1.n_right = n_disk; +face1.n_left= n_diamond; + +face2.vertex1=[1,0]; +face2.vertex2=[0,sqrt(3)]; +face2.n_right = [1, 1]; +face2.n_left= n_diamond; + +face3.vertex1=[0,sqrt(3)]; +face3.vertex2=[-1,0]; +face3.n_right = [1, 1]; +face3.n_left= n_diamond; + +faces={face1,face2,face3}; + + +border1.vertex1=[-2,-2]; +border1.vertex2=[2,-2]; +border1.n_right = [1, 1]; +border1.n_left= [1, 1]; + +border2.vertex1=[2,-2]; +border2.vertex2=[2,2]; +border2.n_right = [1, 1]; +border2.n_left= [1, 1]; + +border3.vertex1=[2,2]; +border3.vertex2=[-2,2]; +border3.n_right = [1, 1]; +border3.n_left= [1, 1]; + +border4.vertex1=[-2,2]; +border4.vertex2=[-2,-2]; +border4.n_right = [1, 1]; +border4.n_left= [1, 1]; + +borders={border1,border2, border3, border4}; + + +border_limits=[-2,-2, 2,2]; +figure(1); +clf; +[processed_beams] = beam_trace(beams, faces, borders, border_limits ); +text(-1,-1, 'red: s-polarization; blue: p-polarization'); + + +print('beams.eps','-depsc2'); +print('beams.png'); + |