summaryrefslogtreecommitdiff
path: root/854/CH1/EX1.4/Example1_4.sce
diff options
context:
space:
mode:
Diffstat (limited to '854/CH1/EX1.4/Example1_4.sce')
-rwxr-xr-x854/CH1/EX1.4/Example1_4.sce36
1 files changed, 36 insertions, 0 deletions
diff --git a/854/CH1/EX1.4/Example1_4.sce b/854/CH1/EX1.4/Example1_4.sce
new file mode 100755
index 000000000..075ea5849
--- /dev/null
+++ b/854/CH1/EX1.4/Example1_4.sce
@@ -0,0 +1,36 @@
+//clear//
+//Caption:Transform the vector of Rectangular coordinates into spherical coordinates
+//Example1.4
+//page 22
+clc;
+y = sym('y');
+x = sym('x');
+z = sym('z');
+ax = sym('ax');
+ay = sym('ay');
+az = sym('az');
+ar = sym('ar');
+aTh = sym('aTh');
+aphi = sym('aphi');
+G = (x*z/y)*ax;
+disp(G,'Given vector in cartesian co-ordiante system B=')
+r = sym('r');
+teta = sym('teta')
+phi = sym('phi')
+x1 = r*sin(teta)*cos(phi);
+y1 = r*sin(teta)*sin(phi);
+z1 = r*cos(teta);
+G1 = (x1*z1/y1)*ax;
+Gr = G1*ar;
+GTh = G1*aTh;
+Gphi = G1*aphi;
+Gsph = [Gr,GTh,Gphi];
+disp(Gr,'Gr=')
+disp(GTh,'GTh=')
+disp(Gphi,'Gphi=')
+//Result
+//Given vector in cartesian co-ordiante system B = ax*x*z/y
+//Gr = ar*ax*cos(phi)*r*cos(teta)/sin(phi)
+//GTh = ax*cos(phi)*r*cos(teta)*aTh/sin(phi)
+//Gphi = aphi*ax*cos(phi)*r*cos(teta)/sin(phi)
+//