diff options
Diffstat (limited to '26/CH6/EX6.4.7')
-rwxr-xr-x | 26/CH6/EX6.4.7/6_4_7.sce | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/26/CH6/EX6.4.7/6_4_7.sce b/26/CH6/EX6.4.7/6_4_7.sce new file mode 100755 index 000000000..90d78f57a --- /dev/null +++ b/26/CH6/EX6.4.7/6_4_7.sce @@ -0,0 +1,19 @@ +disp('to orthogonalise the given vectors using Gram-Schimdt orthogonalisation')
+x1=[2;-5;1]
+x2=[4;-1;2]
+disp(x2,'x2=',x1,'x1=')
+disp('Let v1=x1')
+v1=x1
+disp('v2=x2-((x2.v1)/(v1.v1))*v1')
+a1=x2'*v1
+a2=v1'*v1
+p=(a1/a2)*v1
+v2=x2-p
+disp(p,'-',x2,'=')
+disp(v2,'=')
+disp('Thus, an orthogonal basis is:')
+disp(v2,v1)
+disp('Normalizing v1 and v2, we get')
+s1=sqrt(v1(1,1)^2+v1(2,1)^2+v1(3,1)^2)
+s2=sqrt(v2(1,1)^2+v2(2,1)^2+v2(3,1)^2)
+disp(v2/s2,v1/s1)
\ No newline at end of file |