diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-07-07 01:21:13 -0400 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-07-07 01:21:13 -0400 |
commit | 2e6895ec0b70ba97e06c00f0447f86ad162181fd (patch) | |
tree | 9538ba48e8024c5d874096a81ea0c58f627a5edb /example.m | |
parent | 84d4eb8037900b684030a28851a23fcfcfc1ee21 (diff) | |
download | wgmr-2e6895ec0b70ba97e06c00f0447f86ad162181fd.tar.gz wgmr-2e6895ec0b70ba97e06c00f0447f86ad162181fd.zip |
arbitrary beam tracing
Diffstat (limited to 'example.m')
-rw-r--r-- | example.m | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/example.m b/example.m new file mode 100644 index 0000000..0b1e855 --- /dev/null +++ b/example.m @@ -0,0 +1,30 @@ +beam.k=[1,-.5]; +beam.origin=[0,0]; +beam.face=NA; + +face.vertex1=[1.1,-1]; +face.vertex2=[2.7,1]; +face.n_right = 1; +face.n_left= 2.5; + +face2.vertex1=[-.1,-3]; +face2.vertex2=[-.1,3]; +face2.n_right = 1; +face2.n_left= 1; + +face3.vertex1=[2.1,-3]; +face3.vertex2=[2.1,3]; +face3.n_right = 1.5; +face3.n_left= 1; + +faces={face,face2,face3}; + +[is_face_hit, hit_position, hit_distance, new_beams] = face_beam_interaction(beam, faces); +beam_reflected=new_beams{1}; +beam_refracted=new_beams{2}; + + +[is_face_hit, hit_position, hit_distance, new_beams] = face_beam_interaction(beam_reflected, faces); + +[is_face_hit, hit_position, hit_distance, new_beams] = face_beam_interaction(beam_refracted, faces); + |