summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--face_beam_interaction.m5
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