summaryrefslogtreecommitdiff
path: root/2309/CH5/EX5.a.16
diff options
context:
space:
mode:
Diffstat (limited to '2309/CH5/EX5.a.16')
-rwxr-xr-x2309/CH5/EX5.a.16/A_Ex5_16.sce27
1 files changed, 27 insertions, 0 deletions
diff --git a/2309/CH5/EX5.a.16/A_Ex5_16.sce b/2309/CH5/EX5.a.16/A_Ex5_16.sce
new file mode 100755
index 000000000..3e594a689
--- /dev/null
+++ b/2309/CH5/EX5.a.16/A_Ex5_16.sce
@@ -0,0 +1,27 @@
+// Chapter 5 additional Example 16
+//==============================================================================
+clc;
+clear;
+
+//input data
+// the intercept along X-axis be c1 = a
+// the intercept along Y-axis be c2 = b/2 and
+// the intercept along Z-axis be c3 = 3c
+// Therefore, p = c1/a = a/a = 1
+// q = c2/b = (b/2)/b = 1/2
+// r = c3/c = (3c)/c = 3
+// therefore h = 1/p = 1
+// k = 1/q = 2
+// l = 1/r = 1/3
+// lcm of 1 1 and 3 = 3
+h = 1
+k = 2
+l = 1/3
+p = [1 1 3]
+s = lcm(p);
+h1= s*h
+k1= s*k
+l1= s*l;
+// Output
+mprintf('(h k l) = (%d %d %d)',h1,k1,l1);
+//==============================================================================