summaryrefslogtreecommitdiff
path: root/face_beam_interaction.m
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-07-08 00:33:45 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2011-07-08 00:33:45 -0400
commite8a22ec8f3a329aef2484ca657cea7d4b08e71e7 (patch)
tree9a0f291ecae278cbcdbd249124ad35632ca5be27 /face_beam_interaction.m
parent03730c1a202462c87a7e345f911d459483cc3220 (diff)
downloadwgmr-e8a22ec8f3a329aef2484ca657cea7d4b08e71e7.tar.gz
wgmr-e8a22ec8f3a329aef2484ca657cea7d4b08e71e7.zip
plotting simplified
Diffstat (limited to 'face_beam_interaction.m')
-rw-r--r--face_beam_interaction.m20
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.