aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-07-06 11:48:00 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2011-07-06 11:48:00 -0400
commit84d4eb8037900b684030a28851a23fcfcfc1ee21 (patch)
tree56cfde762881d515a34b28482fa66f5e14dcde87
parent5ab8d0809bed7e971fa3f4ce5950c4e052217263 (diff)
downloadwgmr-84d4eb8037900b684030a28851a23fcfcfc1ee21.tar.gz
wgmr-84d4eb8037900b684030a28851a23fcfcfc1ee21.zip
Add proper prism and rays drawings
-rw-r--r--coupling_angles.m96
1 files changed, 82 insertions, 14 deletions
diff --git a/coupling_angles.m b/coupling_angles.m
index 3af9c87..df7c5f1 100644
--- a/coupling_angles.m
+++ b/coupling_angles.m
@@ -1,12 +1,15 @@
%% Calculates incident angle for proper coupling into the disc via prism
% angle of the prism faces in degrees
-prism_angle=45;
+prism_angle_in_degrees = 45;
+
+prism_angle = prism_angle_in_degrees*pi/180;
%% prism index of refraction
% Rutile (TiO2) see http://refractiveindex.info/?group=CRYSTALS&material=TiO2
n_rutile_o = 2.4885;
n_rutile_e = 2.75324;
+
n_p=n_rutile_o
%% disk material index of refraction
@@ -24,13 +27,20 @@ theta_p=asin(n_d/n_p);
theta_p_in_degrees=theta_p*180/pi
%% now lets see what angle it does with other face of the prism
-theta_p_in_degrees_2=-(theta_p_in_degrees-prism_angle)
-
-%% now we calculate refracted angle out of the prism into the air
-theta_air=asin(n_p*sin(theta_p_in_degrees_2/180*pi));
+theta_p_2=(prism_angle - theta_p);
+theta_p_in_degrees_2=theta_p_2*180/pi
+
+%% now we calculate refracted angle out of the prism into the air with respect to the normal
+% positive means above the normal
+asin_arg=n_p*sin(theta_p_2);
+if (abs(asin_arg)>1) error('quiting: at the right prism face we experienced total internal reflection'); end
+theta_air=asin(asin_arg);
% convert to degrees
theta_air_in_degrees=theta_air*180/pi
+%% angle in the air relative to horizon
+theta_air_rlh=(theta_air+prism_angle);
+theta_air_rlh_in_degrees=theta_air_rlh*180/pi
%% Lets make a picture
% 1st face of the prism lays at y=0 and spans from x=-1 to x=1
@@ -38,10 +48,10 @@ x_face_1=linspace(-1,1);
y_face_1=0*x_face_1;
% 2nd face to the right of origin and at angle prism_angle with respect to negative x direction
x_face_2=linspace(1,0);
-y_face_2=(1-x_face_2)*tan(prism_angle/180*pi);
+y_face_2=(1-x_face_2)*tan(prism_angle);
% 3rd face to the left of origin and at angle prism_angle with respect to negative x direction
x_face_3=linspace(-1,0);
-y_face_3=(x_face_3+1)*tan(prism_angle/180*pi);
+y_face_3=(x_face_3+1)*tan(prism_angle);
%% draw prism
figure(1); hold off;
@@ -49,7 +59,7 @@ plot(x_face_1, y_face_1, 'k-', x_face_2, y_face_2, 'k-', x_face_3, y_face_3, 'k-
hold on
%% disk center will be located in point (0,-R);
-R=.5
+R=.25;
dc_x=0; dc_y=-R;
x_disk=dc_x+R*cos(linspace(0,2*pi));
y_disk=dc_y+R*sin(linspace(0,2*pi));
@@ -58,22 +68,80 @@ plot(x_disk,y_disk,'k-')
%% beam trace inside the prism
% crossing of the beam with 1st (right) face of the prism
-% we are solving cot(theta_p)*x=cot(prism_angle)*(1-x)
-x_cross_1=cot(prism_angle/180*pi)/(cot(prism_angle/180*pi)+cot(theta_p));
+% we are solving cot(theta_p)*x=tan(prism_angle)*(1-x)
+x_cross_1=tan(prism_angle)/(tan(prism_angle)+cot(theta_p));
+y_cross_1=x_cross_1*cot(theta_p);
x_beam_prism_1=linspace(0,x_cross_1);
-y_beam_prism_1=linspace(0,x_cross_1)*cot(theta_p);
+y_beam_prism_1=x_beam_prism_1*cot(theta_p);
plot(x_beam_prism_1, y_beam_prism_1, 'r-');
%% beam out of prism
x_out_strt=x_cross_1;
y_out_strt=x_cross_1*cot(theta_p);
-% angle in the air relative to horizon
-theta_air_rlh=(theta_air_in_degrees-prism_angle)/180*pi;
if (abs(theta_air_rlh)<pi/2) x_out_stop=1; else x_out_stop=0; end
x_out_1=linspace(x_out_strt, x_out_stop);
y_out_1=y_out_strt+tan(theta_air_rlh)*(x_out_1-x_out_strt);
plot(x_out_1, y_out_1, 'r-');
+%% draw normal at the point of 1st face intercection
+theta_norm_rlh=pi/2-prism_angle;
+% coordinates of normal outside the prism
+x_norm_out=linspace(x_cross_1,1);
+y_norm_out=y_cross_1+(x_norm_out-x_cross_1)*tan(theta_norm_rlh);
+
+% coordinates of normal inside the prism
+y_norm_in=linspace(y_cross_1,0);
+x_norm_in=x_cross_1+(y_norm_in-y_cross_1)*tan(theta_norm_rlh+pi);
+plot(x_norm_out, y_norm_out, 'b-', x_norm_in, y_norm_in, 'b-');
+
+%% arc to show theta_air
+R_arc=.1;
+phi_arc=linspace(theta_air_rlh,theta_norm_rlh);
+x_arc_air=x_cross_1+R_arc*cos(phi_arc);
+y_arc_air=y_cross_1+R_arc*sin(phi_arc);
+plot(x_arc_air, y_arc_air, 'b-');
+%% annotation theta_air_in_degrees
+str=sprintf('theta_{a}=%.1f',theta_air_in_degrees);
+str=strcat('\',str,'^{o}');
+text(x_arc_air(end)+.05,y_arc_air(end), str);
+
+%% normal at the disk contact
+y_norm_in=linspace(0.,0.5);
+x_norm_in=y_norm_in*0;
+plot(x_norm_in, y_norm_in, 'b-');
+
+%% arc to show theta_p
+R_arc=.1;
+phi_arc=linspace(pi/2-theta_p,pi/2);
+x_arc_prism=R_arc*cos(phi_arc);
+y_arc_prism=R_arc*sin(phi_arc);
+plot(x_arc_prism, y_arc_prism, 'b-');
+%% annotation theta_air_in_degrees
+str=sprintf('theta_{p}=%.1f',theta_p_in_degrees);
+str=strcat('\',str,'^{o}');
+text(x_arc_prism(1)+0.05, y_arc_prism(1), str);
+
+%% arc to show theta_p_2
+R_arc=.1;
+phi_arc=linspace(theta_norm_rlh+theta_p_2+pi,theta_norm_rlh+pi);
+x_arc_prism_2=x_cross_1+R_arc*cos(phi_arc);
+y_arc_prism_2=y_cross_1+R_arc*sin(phi_arc);
+plot(x_arc_prism_2, y_arc_prism_2, 'b-');
+%% annotation theta_air_in_degrees
+str=sprintf('theta_{p2}=%.1f',theta_p_in_degrees_2);
+str=strcat('\',str,'^{o}');
+text(x_arc_prism_2(1)+.05,y_arc_prism_2(1), str);
+
+
+str=sprintf('n_d=%.3f',n_d);
+text(0,1.1, str);
+
+str=sprintf('n_p=%.3f',n_p);
+text(0,1.2, str);
+
% force same aspect ratio for axis
-axis('square');
+axis([-1,1,-0.5,1.5],'equal');
+
+%% output of the plot to the file
+print('prism_disk_coupling.pdf');