aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-07-07 22:13:43 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2011-07-07 22:13:43 -0400
commit3194be5298731808535421f24153db9ed3a2dc7b (patch)
tree7ca70f11deb6c92f5166dd8070b36ccc152f9a24
parentcbfbf172f99f57958ad185cab7c9af375895f8e5 (diff)
downloadwgmr-3194be5298731808535421f24153db9ed3a2dc7b.tar.gz
wgmr-3194be5298731808535421f24153db9ed3a2dc7b.zip
beams of differnt polarization have different colors
-rw-r--r--face_beam_interaction.m8
1 files changed, 7 insertions, 1 deletions
diff --git a/face_beam_interaction.m b/face_beam_interaction.m
index a94b2f2..2204bcc 100644
--- a/face_beam_interaction.m
+++ b/face_beam_interaction.m
@@ -59,7 +59,13 @@ function [is_face_hit, hit_position, hit_distance, new_beams] = face_beam_inter
% draw beam
x=beam.origin(1)+k(1)*t;
y=beam.origin(2)+k(2)*t;
- plot(x,y,'r-');
+ if ( polarization == 1)
+ line_str='r-';
+ else
+ line_str='b-';
+ end
+ plot(x,y,line_str);
+
% find is beam arriving from left or right. I will use vectors cross product property.
% if z component of the product 'k x kf' is positive then beam arrives from the left