From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 854/CH1/EX1.4/Example1_4.sce | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 854/CH1/EX1.4/Example1_4.sce (limited to '854/CH1/EX1.4') 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) +// -- cgit