summaryrefslogtreecommitdiff
path: root/854/CH1/EX1.3/Example1_3.sce
blob: 46a410b199c290f361a44b5907ad44451e66c6f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//clear//
//Caption:Transform the vector of Rectangular coordinates into cylindrical coordinates
//Example1.3
//page 18
clc;
y = sym('y');
x = sym('x');
z = sym('z');
ax = sym('ax');
ay = sym('ay');
az = sym('az');
ar = sym('ar');
aphi = sym('aphi');
phi = sym('phi');
B = y*ax-x*ay+z*az;
disp(B,'Given vector in cartesian co-ordiante system B=')
Br = B*ar;
Bphi = B*aphi;
Bz = B*az;
disp('Components of cylindrical vector B')
disp(Br,'Br=')
disp(Bphi,'Bphi=')
disp(Bz,'Bz=')
//Result
//Given vector in cartesian co-ordiante system B=   
//  az*z+ax*y-ay*x   
// Components of cylindrical vector B   
// Br=   
//  ar*(az*z+ax*y-ay*x)   
// Bphi=   
//  aphi*(az*z+ax*y-ay*x)   
// Bz=   
//  az*(az*z+ax*y-ay*x) 
//