diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-07-08 12:18:05 -0400 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-07-08 12:18:05 -0400 |
commit | 659c287bfd1c78ed6b17d4d53d58119cd437bf97 (patch) | |
tree | 87ccd7bcbf7b22178a95fbe723b00333421f6e7f | |
parent | ffefd65055a6fa0542fe56f5a544749b0eb568fa (diff) | |
download | wgmr-659c287bfd1c78ed6b17d4d53d58119cd437bf97.tar.gz wgmr-659c287bfd1c78ed6b17d4d53d58119cd437bf97.zip |
fix incendent angle calculaton
-rw-r--r-- | face_beam_interaction.m | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/face_beam_interaction.m b/face_beam_interaction.m index 33345a2..3bc3e4a 100644 --- a/face_beam_interaction.m +++ b/face_beam_interaction.m @@ -6,6 +6,7 @@ function [is_face_hit, hit_position, hit_distance, new_beams] = face_beam_inter % beam.intensity - intensity of the beam % beam.face - if beam starts from face then its index is here % beam.polarization - can be either 1 for 's' or 2 for 'p' + % beam.status - could be 'reflected', 'refracted', 'incoming' % faces cell array of face structures % face - structure definiong the beam % face.vertex1 - [x,y] of the 1st point/vertex of the face @@ -97,7 +98,7 @@ function [is_face_hit, hit_position, hit_distance, new_beams] = face_beam_inter theta_i=pi-theta_i; end if( theta_i < -pi/2) - theta_i=-pi+theta_i; + theta_i=-pi-theta_i; end % angle of the normal with respect to horizon @@ -120,6 +121,7 @@ function [is_face_hit, hit_position, hit_distance, new_beams] = face_beam_inter beam_reflected.face=closest_face_index; beam_reflected.polarization = polarization; beam_reflected.intensity = beam.intensity * reflectivity; + beam_reflected.status = 'reflected'; new_beams{1} = beam_reflected; @@ -140,6 +142,7 @@ function [is_face_hit, hit_position, hit_distance, new_beams] = face_beam_inter beam_refracted.face=closest_face_index; beam_refracted.polarization = polarization; beam_refracted.intensity = beam.intensity * transmission; + beam_refracted.status = 'refracted'; new_beams{2} = beam_refracted; end end |