summaryrefslogtreecommitdiff
path: root/2411/CH7/EX7.6/Ex7_6.sce
diff options
context:
space:
mode:
Diffstat (limited to '2411/CH7/EX7.6/Ex7_6.sce')
-rwxr-xr-x2411/CH7/EX7.6/Ex7_6.sce26
1 files changed, 26 insertions, 0 deletions
diff --git a/2411/CH7/EX7.6/Ex7_6.sce b/2411/CH7/EX7.6/Ex7_6.sce
new file mode 100755
index 000000000..899229b02
--- /dev/null
+++ b/2411/CH7/EX7.6/Ex7_6.sce
@@ -0,0 +1,26 @@
+// Scilab Code Ex7.6: Page-378 (2008)
+clc; clear;
+// For first set (3, 2, 2)
+m = 3; n = 2; p = 2; // Coefficients of intercepts along three axes
+m_inv = 1/m; // Reciprocate the first coefficient
+n_inv = 1/n; // Reciprocate the second coefficient
+p_inv = 1/p; // Reciprocate the third coefficient
+mul_fact = double(lcm(int32([m,n,p]))); // Find l.c.m. of m,n and p
+m1 = m_inv*mul_fact; // Clear the first fraction
+m2 = n_inv*mul_fact; // Clear the second fraction
+m3 = p_inv*mul_fact; // Clear the third fraction
+printf("\nThe plane (%d %d %d) has intercepts %da, %db and %dc on the three axes.", m, n, p, m1, m2, m3);
+// For second set (1 1 1)
+m = 1; n = 1; p = 1; // Coefficients of intercepts along three axes
+m_inv = 1/m; // Reciprocate the first coefficient
+n_inv = 1/n; // Reciprocate the second coefficient
+p_inv = 1/p; // Reciprocate the third coefficient
+mul_fact = double(lcm(int32([m,n,p]))); // Find l.c.m. of m,n and p
+m1 = m_inv*mul_fact; // Clear the first fraction
+m2 = n_inv*mul_fact; // Clear the second fraction
+m3 = p_inv*mul_fact; // Clear the third fraction
+printf("\nThe plane (%d %d %d) has intercepts a, b and c on the three axes.", m, n, p);
+
+// Result
+// The plane (3 2 2) has intercepts 2a, 3b and 3c on the three axes.
+// The plane (1 1 1) has intercepts a, b and c on the three axes. \ No newline at end of file