summaryrefslogtreecommitdiff
path: root/1871/CH6/EX6.8/Ch06Ex8.sce
diff options
context:
space:
mode:
Diffstat (limited to '1871/CH6/EX6.8/Ch06Ex8.sce')
-rwxr-xr-x1871/CH6/EX6.8/Ch06Ex8.sce21
1 files changed, 21 insertions, 0 deletions
diff --git a/1871/CH6/EX6.8/Ch06Ex8.sce b/1871/CH6/EX6.8/Ch06Ex8.sce
new file mode 100755
index 000000000..11963c1e5
--- /dev/null
+++ b/1871/CH6/EX6.8/Ch06Ex8.sce
@@ -0,0 +1,21 @@
+// Scilab code Ex6.8: Pg:250 (2008)
+clc;clear;
+// Define function to convert degrees to degree and minute
+function [deg, minute] = deg2degmin(theta)
+ deg = floor(theta);
+ minute = ceil((theta-deg)*60);
+endfunction
+C = 48; // Critical angle of incidence, degree
+mu = 1/sind(C); // Index of refraction
+// From Brewester's law mu = tan i_p, solving for i_p
+i_p = atand(mu); // Polarizing angle, degree
+// Since i_p + r = %pi/2, solving for r
+r = 90 - i_p; // Angle of refraction, degree
+[d1, m1] = deg2degmin(i_p);
+[d2, m2] = deg2degmin(r);
+printf("\nThe polarizing angle = %2d degree %2d minute", d1, m1);
+printf("\nThe angle of refraction = %2d degree %2d minute", d2, m2);
+
+// Result
+// The polarizing angle = 53 degree 23 minute
+// The angle of refraction = 36 degree 38 minute \ No newline at end of file