From 3194be5298731808535421f24153db9ed3a2dc7b Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Thu, 7 Jul 2011 22:13:43 -0400 Subject: beams of differnt polarization have different colors --- face_beam_interaction.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3