diff options
author | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
---|---|---|
committer | prashantsinalkar | 2017-10-10 12:27:19 +0530 |
commit | 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch) | |
tree | dbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3870/CH1/EX1.2/1_2.sce | |
parent | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff) | |
download | Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2 Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip |
initial commit / add all books
Diffstat (limited to '3870/CH1/EX1.2/1_2.sce')
-rw-r--r-- | 3870/CH1/EX1.2/1_2.sce | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/3870/CH1/EX1.2/1_2.sce b/3870/CH1/EX1.2/1_2.sce new file mode 100644 index 000000000..546c6babd --- /dev/null +++ b/3870/CH1/EX1.2/1_2.sce @@ -0,0 +1,21 @@ +//Developed in Windows 7 Operating system 64-bit
+//Platform Scilab 6.0.0
+clc;clear;
+//Example 1.2
+//Find the angle between the face diagonals of a cube
+
+//Given data
+a=[1 0 1]; // Vector A=1x^+0y^+1z^
+b=[0 1 1]; // Vector B=0x^+1y^+1z^
+amod=sqrt(a(1)^2+a(2)^2+a(3)^2);
+bmod=sqrt(b(1)^2+b(2)^2+b(3)^2);
+
+//Calculation
+c=a.*b;
+dot=0;
+for i=1:3
+ dot=dot+c(i);
+end
+theta=acosd(dot/(amod*bmod));
+
+disp(theta,'Angle(Dg.) betwen the face diagonals of a cube is : ')
|