summaryrefslogtreecommitdiff
path: root/635/CH1/EX1.18/Ch01Ex18.sci
diff options
context:
space:
mode:
Diffstat (limited to '635/CH1/EX1.18/Ch01Ex18.sci')
-rwxr-xr-x635/CH1/EX1.18/Ch01Ex18.sci13
1 files changed, 13 insertions, 0 deletions
diff --git a/635/CH1/EX1.18/Ch01Ex18.sci b/635/CH1/EX1.18/Ch01Ex18.sci
new file mode 100755
index 000000000..191fb004e
--- /dev/null
+++ b/635/CH1/EX1.18/Ch01Ex18.sci
@@ -0,0 +1,13 @@
+// Scilab Code Ex 1.18 Angle between two directions of cubic crystal: Page-23(2010)
+h1 = 1; k1 = 1; l1 = 1 // Miller indices for first set of planes
+h2 = -1; k2 = -1; l2 = 1; // Miller indices for second set of planes
+// We know that
+// cos(theta) = (h1*h2+k1*k2+l1*l2)/(sqrt(h1^2+k1^2+l1^2)*sqrt(h2^2+k2^2+l2^2))
+// Solving for theta
+theta = acos((h1*h2+k1*k2+l1*l2)/(sqrt(h1^2+k1^2+l1^2)*sqrt(h2^2+k2^2+l2^2)));
+printf("\nThe angle between [%d%d%d] and [%d %d %d] directions in the cubic crystal, in degrees, is : %4.1f", h1,k1,l1,h2,k2,l2, theta*180/%pi);
+
+// Result
+// The angle between [111] and [-1-1 1] directions in the cubic crystal, in degrees, is :
+// 109.5
+