diff options
Diffstat (limited to 'face_beam_interaction.m')
-rw-r--r-- | face_beam_interaction.m | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/face_beam_interaction.m b/face_beam_interaction.m index 2204bcc..dce399a 100644 --- a/face_beam_interaction.m +++ b/face_beam_interaction.m @@ -51,20 +51,20 @@ function [is_face_hit, hit_position, hit_distance, new_beams] = face_beam_inter hold on; % draw face - t=linspace(0,1); - x=face.vertex1(1)+kf(1)*t; - y=face.vertex1(2)+kf(2)*t; - plot(x,y,'k-'); - t=linspace(0,hit_distance); + line([face.vertex1(1), face.vertex2(1)], [face.vertex1(2), face.vertex2(2)] , 'linestyle', '-', 'color', [0,0,0] ); % draw beam - x=beam.origin(1)+k(1)*t; - y=beam.origin(2)+k(2)*t; + Ncolors=256; + linewidth=2; if ( polarization == 1) - line_str='r-'; + % s-polarization + line_base_color=[1,0,0]; % RGB - red else - line_str='b-'; + % p-polarization + line_base_color=[0,0,1]; % RGB - blue end - plot(x,y,line_str); + %plot(x,y,line_str); + line_color = color_gradient( beam.intensity*Ncolors, line_base_color, Ncolors); + line([beam.origin(1), hit_position(1)], [beam.origin(2), hit_position(2)], 'color', line_color, 'linewidth', 3, 'linestyle', '-'); % find is beam arriving from left or right. I will use vectors cross product property. |