summaryrefslogtreecommitdiff
path: root/3293/CH8/EX8.9/Ex8_9.sce
diff options
context:
space:
mode:
Diffstat (limited to '3293/CH8/EX8.9/Ex8_9.sce')
-rwxr-xr-x3293/CH8/EX8.9/Ex8_9.sce34
1 files changed, 34 insertions, 0 deletions
diff --git a/3293/CH8/EX8.9/Ex8_9.sce b/3293/CH8/EX8.9/Ex8_9.sce
new file mode 100755
index 000000000..b3f53a518
--- /dev/null
+++ b/3293/CH8/EX8.9/Ex8_9.sce
@@ -0,0 +1,34 @@
+//page 278
+//Example 8.9
+clc;
+clear;
+close;
+a = round(rand(1,2) * 10);
+x = a(1);
+y = a(2);
+b = [-y x];
+disp(a,'(x,y) = ');
+disp(b,'(-y,x) = ');
+disp('Inner product of these vectors is:');
+t = -x*y + y*x;
+disp(t,'(x,y)|(-y,x) = ');
+disp('So, these are orthogonal.');
+disp('------------------------------------------');
+disp('If inner product is defined as:');
+disp('(x1,x2)|(y1,y2) = x1y1- x2y1 - x1y2 + 4x2y2');
+disp('Then, (x,y)|(-y,x) = -x*y+y^2-x^2+4*x*y = 0 if,');
+disp('y = 1/2(-3 + sqrt(13))*x');
+disp('or');
+disp('y = 1/2(-3 - sqrt(13))*x');
+disp('Hence,');
+if y == 1/2*(-3 + sqrt(13))*x | y == 1/2*(-3 - sqrt(13))*x then
+disp(a);
+disp('is orthogonal to');
+disp(b);
+else
+disp(a);
+disp('is not orthogonal to');
+disp(b);
+end
+//end
+