EE 204 Chapter 2 Coordinate Systems
EE 204 Chapter 2 Coordinate Systems
COORDINATE SYSTEMS
AND TRANSFORMATION
History teaches us that man learns nothing from history.
—HEGEL
2.1 INTRODUCTION
In general, the physical quantities we shall be dealing with in EM are functions of space
and time. In order to describe the spatial variations of the quantities, we must be able to
define all points uniquely in space in a suitable manner. This requires using an appropriate
coordinate system.
A point or vector can be represented in any curvilinear coordinate system, which may
be orthogonal or nonorthogonal.
An orthogonal system is one in which the coordinate surfaces are mutually perpendicular.
Nonorthogonal systems are hard to work with, and they are of little or no practical use.
Examples of orthogonal coordinate systems include the Cartesian (or rectangular), the cir-
cular cylindrical, the spherical, the elliptic cylindrical, the parabolic cylindrical, the conical,
the prolate spheroidal, the oblate spheroidal, and the ellipsoidal.1 A considerable amount of
work and time may be saved by choosing a coordinate system that best fits a given problem.
A hard problem in one coordinate system may turn out to be easy in another system.
In this text, we shall restrict ourselves to the three best-known coordinate systems:
the Cartesian, the circular cylindrical, and the spherical. Although we have considered the
Cartesian system in Chapter 1, we shall consider it in detail in this chapter. We should bear
in mind that the concepts covered in Chapter 1 and demonstrated in Cartesian coordinates
are equally applicable to other systems of coordinates. For example, the procedure for find-
ing the dot or cross product of two vectors in a cylindrical system is the same as that used
in the Cartesian system in Chapter 1.
1
For an introductory treatment of these coordinate systems, see M. R. Spiegel and J. Liu, Mathematical Handbook
of Formulas and Tables. New York: McGraw-Hill, 2nd ed., 1999, pp. 126–130.
31
where ax, ay, and az are unit vectors along the x-, y-, and z-directions as shown in Figure 1.1.
The coordinate system may be either right-handed or left-handed. See Figure 1.13. It is cus-
tomary to use the right-handed system.
The circular cylindrical coordinate system is very convenient whenever we are dealing with
problems having cylindrical symmetry, such as dealing with a coaxial transmission line.
A point P in cylindrical coordinates is represented as 1 r, f, z 2 and is as shown in
Figure 2.1. Observe Figure 2.1 closely and note how we define each space variable: r is the
az
ρ P aφ
aρ
y
φ
radius of the cylinder passing through P or the radial distance from the z-axis; f, called the
azimuthal angle, is measured from the x-axis in the xy-plane; and z is the same as in the
Cartesian system. The ranges of the variables are
0#r,`
0 # f , 2p (2.3)
2` , z , `
where ar, af, and az are unit vectors in the r-, f-, and z-directions as illustrated in
Figure 2.1. Note that af is not in degrees; it assumes the units of A. For example, if a
force of 10 N acts on a particle in a circular motion, the force may be represented as
F 5 10af N. In this case, af is in newtons.
The magnitude of A is
Notice that the unit vectors ar, af, and az are mutually perpendicular because our coor-
dinate system is orthogonal; ar points in the direction of increasing r, af in the direction
of increasing f, and az in the positive z-direction. Thus,
ar # ar 5 af # af 5 az # az 5 1 (2.6a)
ar # af 5 af # az 5 az # ar 5 0 (2.6b)
ar 3 af 5 az (2.6c)
af 3 az 5 ar (2.6d)
az 3 ar 5 af (2.6e)
where eqs. (2.6c) to (2.6e) are obtained in cyclic permutation (see Figure 1.9). They also show
that the system is right-handed, following the cyclic ordering r S f S z S r S f S . . . .
The relationships between the variables 1 x, y, z 2 of the Cartesian coordinate system
and those of the cylindrical system 1 r, f, z 2 are easily obtained from Figure 2.2 as
y
r 5 "x2 1 y2, f 5 tan21 , z5z (2.7)
x
or
The relationships between 1 ax, ay, az 2 and 1 ar, af, az 2 are obtained geometrically from
Figure 2.3:
ax 5 cos f ar 2 sin f af
ay 5 sin f ar 1 cos f af (2.9)
az 5 az
or
ar 5 cos f ax 1 sin f ay
af 5 2sin f ax 1 cos f ay (2.10)
az 5 az
Finally, the relationships between 1 Ax, Ay, Az 2 and 1 Ar, Af, Az 2 are obtained by simply
substituting eq. (2.9) into eq. (2.2) and collecting terms. Thus,
or
Ar 5 Ax cos f 1 Ay sin f
Af 5 2Ax sin f 1 Ay cos f (2.12)
Az 5 Az
Ar cos f sin f 0 Ax
£ Af § 5 £ 2sin f cos f 0 § £ Ay § (2.13)
Az 0 0 1 Az
Ax cos f sin f 0 21 Ar
£ Ay § 5 £ 2sin f cos f 0 § £ Af § (2.14)
Az 0 0 1 Az
Ax cos f 2sin f 0 Ar
£ Ay § 5 £ sin f cos f 0 § £ Af § (2.15)
Az 0 0 1 Az
An alternative way of obtaining eq. (2.13) or (2.15) is by using the dot product. For
example,
Ax ax # a r a x # a f a x # a z Ar
£ A y § 5 £ ay # ar ay # af ay # az § £ A f § (2.16)
Az az # ar az # af az # az A z
Although cylindrical coordinates are covered in calculus texts, the spherical coordinates
are rarely covered. The spherical coordinate system is most appropriate when one is deal-
ing with problems having a degree of spherical symmetry. A point P can be represented
as 1 r, u, f 2 and is illustrated in Figure 2.4. From Figure 2.4, we notice that r is defined as
the distance from the origin to point P or the radius of a sphere centered at the origin and
passing through P; u (called the colatitude) is the angle between the z-axis and the position
vector of P; and f is measured from the x-axis (the same azimuthal angle in cylindrical
coordinates). According to these definitions, the ranges of the variables are
0#r,`
0#u#p (2.17)
0 # f , 2p
where ar, au, and af are unit vectors along the r-, u-, and f-directions. The magnitude of
A is
The unit vectors ar, au, and af are mutually orthogonal, ar being directed along the
radius or in the direction of increasing r, au in the direction of increasing u, and af in the
direction of increasing f. Thus,
ar # ar 5 au # au 5 af # af 5 1
ar # au 5 au # af 5 af # ar 5 0
ar 3 au 5 af (2.20)
au 3 af 5 ar
af 3 ar 5 au
Equation (2.20) shows that the coordinate system is orthogonal and right-handed.
The space variables 1 x, y, z 2 in Cartesian coordinates can be related to variables
1 r, u, f 2 of a spherical coordinate system. From Figure 2.5 it is easy to notice that
"x2 1 y2 y
r 5 "x2 1 y2 1 z2, u 5 tan21 , f 5 tan21 (2.21)
z x
or
or
The components of vector A 5 1 Ax, Ay, Az 2 and A 5 1 Ar, Au, Af 2 are related by substituting
eq. (2.23) into eq. (2.2) and collecting terms. Thus,
ρ = r sin θ
z = r cos θ
r
θ z
y
ρ x = ρ cos φ
φ
y = ρ sin φ
In matrix form, the 1 Ax, Ay, Az 2 S 1 Ar, Au, Af 2 vector transformation is performed
according to
The inverse transformation 1 Ar, Au, Af 2 S 1 Ax, Ay, Az 2 is similarly obtained, or we obtain
it from eq. (2.23). Thus,
Alternatively, we may obtain eqs. (2.27) and (2.28) by using the dot product. For
example,
Ar ar # a x a r # a y a r # a z Ax
£ A u § 5 £ au # ax au # ay au # az § £ A y § (2.29)
Af af # ax af # ay af # az A z
For the sake of completeness, it may be instructive to obtain the point or vector
transformation relationships between cylindrical and spherical coordinates. We shall use
Figures 2.5 and 2.6 (where f is held constant, since it is common to both systems). This
will be left as an exercise (see Problem 2.16). Note that in a point or vector transformation,
the point or vector has not changed; it is only expressed differently. Thus, for example, the
magnitude of a vector will remain the same after the transformation, and this may serve as
a way of checking the result of the transformation.
The distance between two points is usually necessary in EM theory. The distance d
between two points with position vectors r1 and r2 is generally given by
d 5 0 r2 2 r1 0 (2.30)
or
d2 5 1 x2 2 x1 2 2 1 1 y2 2 y1 2 2 1 1 z2 2 z1 2 2 1 Cartesian 2 (2.31)
d2 5 r22 1 r21 2 2r1r2 cos 1 f2 2 f1 2 1 1 z2 2 z1 2 2 1 cylindrical 2 (2.32)
d2 5 r22 1 r21 2 2r1r2 cos u 2 cos u 1
(2.33)
2 2r1r2 sin u 2 sin u 1 cos 1 f2 2 f1 2 1 spherical 2
Given point P 1 22, 6, 3 2 and vector A 5 yax 1 1 x 1 z 2 ay, express P and A in cylindrical
EXAMPLE 2.1
and spherical coordinates. Evaluate A at P in the Cartesian, cylindrical, and spherical systems.
Solution:
At point P: x 5 22, y 5 6, z 5 3. Hence,
r 5 "x2 1 y2 1 z2 5 "4 1 36 1 9 5 7
"x2 1 y2 "40
u 5 tan21 5 tan21 5 64.62!
z 3
Thus,
A 5 6ax 1 ay
Ar cos f sin f 0 y
£ Af § 5 £ 2sin f cos f 0 § £ x 1 z §
Az 0 0 1 0
or
Ar 5 y cos f 1 1 x 1 z 2 sin f
Af 5 2y sin f 1 1 x 1 z 2 cos f
Az 5 0
At P
6
r 5 "40, tan f 5
22
Hence,
22 6
cos f 5 , sin f 5
"40 "40
22 # 6 22 6
A 5 c "40 # 1 a"40 # 1 3b # d ar
"40 "40 "40 "40
36 22 22
1 c 2"40 # 1 a"40 # 1 3b # d af
40 "40 "40
26 38
5 ar 2 af 5 20.9487ar 2 6.008af
"40 "40
or
But x 5 r sin u cos f, y 5 r sin u sin f, and z 5 r cos u. Substituting these yields
A 5 1 Ar, Au, Af 2
5 r 3 sin2 u cos f sin f 1 1 sin u cos f 1 cos u 2 sin u sin f 4 ar
1 r 3 sin u cos u sin f cos f 1 1 sin u cos f 1 cos u 2 cos u sin f 4 au
1 r 3 2sin u sin2 f 1 1 sin u cos f 1 cos u 2 cos f 4 af
At P
6 "40
r 5 7, tan f 5 , tan u 5
22 3
Hence,
22 6 3 "40
cos f 5 , sin f 5 , cos u 5 , sin u 5
"40 "40 7 7
40 22 # 6 "40 # 22 3 "40 # 6
A57# c # 1a 1 b# d ar
49 "40 "40 7 "40 7 7 "40
"40 # 3 # 6 # 22 "40 # 22 3 3 6
17 # c 1 a 1 b# # da
7 7 "40 "40 7 "40 7 7 "40 u
2"40 # 36 "40 # 22 3 22
17 # c 1a 1 b# d af
7 40 7 "40 7 "40
26 18 38
5 ar 2 au 2 af
7 7"40 "40
5 20.8571ar 2 0.4066au 2 6.008af
(a) Convert points P 1 1, 3, 5 2 , T 1 0, 24, 3 2 , and S 1 23, 24, 210 2 from Cartesian to
cylindrical and spherical coordinates.
10
B5 a 1 r cos u au 1 af
r r
in Cartesian and cylindrical coordinates. Find B 1 23, 4, 0 2 and B 1 5, p/2, 22 2 .
Solution:
Using eq. (2.28):
10
Bx sin u cos f cos u cos f 2sin f r
£ By § 5 £ sin u sin f cos u sin f cos f § r cos u
Bz cos u 2sin u 0 1
or
10
Bx 5 sin u cos f 1 r cos2 u cos f 2 sin f
r
10
By 5 sin u sin f 1 r cos2 u sin f 1 cos f
r
10
Bz 5 cos u 2 r cos u sin u
r
"x2 1 y2 y
But r 5 "x2 1 y2 1 z2, u 5 tan21 , and f 5 tan21
z x
Hence,
r "x2 1 y2 z z
sin u 5 5 , cos u 5 5
r "x2 1 y2 1 z2 r "x2 1 y2 1 z2
y y x x
sin f 5 5 , cos f 5 5
r "x 1 y2
2 r "x 1 y2
2
10x xz 2 y
5 2 2 2 1 2
x 1y 1z " 1 x2 1 y2 2 1 x2 1 y2 1 z2 2 " 1 x2 1 y2 2
10y yz2 x
5 2 2 2 1 1
x 1y 1z " 1 x2 1 y2 2 1 x2 1 y2 1 z2 2 "x2 1 y2
10z z"x2 1 y2
Bz 5 2
x2 1 y2 1 z2 "x2 1 y2 1 z2
B 5 Bx ax 1 By ay 1 Bz az
B 5 22ax 1 ay
10
Br sin u cos u 0 r
£ Bf § 5 £ 0 0 1 § r cos u
Bz cos u 2sin u 0 1
or
10
sin u 1 r cos2 u
Br 5
r
Bf 5 1
10
Bz 5 cos u 2 r sin u cos u
r
r
But r 5 "r2 1 z2 and u 5 tan21
z
Thus,
r z
sin u 5 , cos u 5
2 2
"r 1 z "r 1 z2 2
10r 2 2 # z2
Br 5 2 1 "r 1 z
r 1 z2 r2 1 z2
10z 2 2 #
rz
Bz 5 2 2 2 "r 1 z
r 1z r 1 z2
2
Hence,
10r z2 10z rz
B5a 2 2 1 b ar 1 af 1 a 2 2 2 b az
r 1z 2
"r 1 z2 r 1z "r2 1 z2
At 1 5, p/2, 22 2 , r 5 5, f 5 p/2, and z 5 22, so
50 4 220 10
B5a 1 b ar 1 af 1 a 1 b az
29 "29 29 "29
5 2.467ar 1 af 1 1.167az
0 B 1 x, y, z 2 0 5 0 B 1 r, f, z 2 0 5 0 B 1 r, u, f 2 0 5 2.907
This may be used to check the correctness of the result whenever possible.
Cartesian system, if we keep x constant and allow y and z to vary, an infinite plane is gener-
ated. Thus we could have infinite planes
x 5 constant
y 5 constant (2.34)
z 5 constant
which are perpendicular to the x-, y-, and z-axes, respectively, as shown in Figure 2.7. The
intersection of two planes is a line. For example,
is the line RPQ parallel to the z-axis. The intersection of three planes is a point. For example,
is the point P 1 x, y, z 2 . Thus we may define point P as the intersection of three orthogonal
infinite planes. If P is 1 1, 25, 3 2 , then P is the intersection of planes x 5 1, y 5 25, and
z 5 3.
Orthogonal surfaces in cylindrical coordinates can likewise be generated. The
surfaces
r 5 constant
f 5 constant (2.37)
z 5 constant
are illustrated in Figure 2.8, where it is easy to observe that r 5 constant is a circular cylin-
der, f 5 constant is a semi-infinite plane with its edge along the z-axis, and z 5 constant
is the same infinite plane as in a Cartesian system. Where two surfaces meet is either a line
or a circle. Thus,
r 5 constant
u 5 constant (2.40)
f 5 constant
which are shown in Figure 2.9, where we notice that r 5 constant is a sphere of radius r
with its center at the origin; u 5 constant is a circular cone with the z-axis as its axis and
the origin as its vertex; f 5 constant is the semi-infinite plane as in a cylindrical system.
A line is formed by the intersection of two surfaces. For example,
is a semicircle passing through Q and P. The intersection of three surfaces gives a point.
Thus,
is the point P 1 5, 30°, 60° 2 . We notice that in general, a point in three-dimensional space can be
identified as the intersection of three mutually orthogonal surfaces. Also, a unit normal vector
to the surface n 5 constant is 6an, where n is x, y, z, r, f, r, or u. For example, to the plane
x 5 5, a unit normal vector is 6ax and to the plane f 5 20°, a unit normal vector is 'af.
Two uniform vector fields are given by E 5 25ar 1 10af 1 3az and F 5 ar1
EXAMPLE 2.3
2af 2 6az. Calculate
(a) 0 E 3 F 0
(b) The vector component of E at P 1 5, p/2, 3 2 parallel to the line x 5 2, z 5 3
(c) The angle that E makes with the surface z 5 3 at P
Solution:
ar af az
(a) E 3 F 5 † 25 10 3†
1 2 26
5 1 260 2 6 2 ar 1 1 3 2 30 2 af 1 1 210 2 10 2 az
5 1 266, 227, 220 2
0 E 3 F 0 5 "662 1 272 1 202 5 74.06
(b) Line x 5 2, z 5 3 is parallel to the y-axis, so the component of E parallel to the given
line is
1 E # ay 2 ay
But at P 1 5, p/2, 3 2
ay 5 sin f ar 1 cos f af
5 sin p/2 ar 1 cos p/2 af 5 ar
Therefore,
1 E # ay 2 ay 5 1 E # ar 2 ar 5 25ar 1 or 25ay 2
(c) Since the z-axis is normal to the surface z 5 3, we can use the dot product to find the
angle between the z-axis and E, as shown in Figure 2.10:
90! 2 u Ez 5 15.02!
(a) H # ax
(b) H 3 au
(c) The vector component of H normal to surface r 5 1
(d) The scalar component of H tangential to the plane z 5 0
Answer: (a) #0.0586, (b) #0.06767 ar, (c) 0 ar, (d) 0.06767.
1
D 5 r sin f ar 2 sin u cos f au 1 r2af
r
determine
(a) D at P 1 10, 150!, 330! 2
(b) The component of D tangential to the spherical surface r 5 10 at P
(c) A unit vector at P perpendicular to D and tangential to the cone u 5 150!
Solution:
(a) At P, r 5 10, u 5 150!, and f 5 330!. Hence,
1
D 5 10 sin 330! ar 2 sin 150! cos 330! au 1 100 af 5 1 25, 20.043, 100 2
10
(b) Any vector D can always be resolved into two orthogonal components:
D 5 Dt 1 D n
where Dt is tangential to a given surface and Dn is normal to it. In our case, since ar is
normal to the surface r " 10,
Dn 5 r sin f ar 5 25ar
Hence,
Dt 5 D 2 Dn 5 20.043au 1 100af
(c) A vector at P perpendicular to D and tangential to the cone u 5 150! is the same as the
vector perpendicular to both D and au. Hence,
ar au af
D 3 au 5 † 25 20.043 100 †
0 1 0
5 2100ar 2 5af
2100ar 2 5af
a5 5 20.9988ar 2 0.0499af
"1002 1 52
MATLAB 2.1 % This script allows the user to input a coordinate in either
% rectangular, cylindrical, or spherical coordinates and
% retrieve the answer in the other coordinate systems
clear
% prompt the user for the coordinate system
disp(‘Enter the coordinate system of the input coordinate’);
coord_sys = input(‘ (r, c, or s)... \n > ‘,’s’);
% if user entered something other than “r” “c” or “s”
% set default as “r”
if isempty(coord_sys); coord_sys = ‘r’; end
if coord_sys == ‘r’;
% prompt the user for the coordinate
disp(‘Enter the rectangular coordinate in the ‘);
crd = input(‘format [x y z]... \n > ‘);
% check input to see if empty and set to 0 if so
if isempty(crd); crd = [0 0 0]; end
disp(‘Cylindrical coordinates [rho phi(rad) z]:’)
% display the result... the [ ] and enclose a
% three-dimensional vector
disp([sqrt(crd(1)^2+crd(2)^2) atan2(crd(2),crd(1)) crd(3)])
disp(‘Spherical coordinates [r phi(rad) theta(rad]:’)
disp([norm(crd) atan2(crd(2),crd(1)) acos(crd(3)/
norm(crd))])
elseif coord_sys == ‘c’; % if not r but c execute this block
disp(‘Enter the cylindrical coordinate in the format’);
crd = input(‘ [\rho \phi z]... \n > ‘);
% check input to see if empty and set to 0 if so
if isempty(crd); crd = [0 0 0]; end
disp(‘Rectangular coordinates [x y z]:’)
disp([crd(1)*cos(crd(2)) crd(1)*sin(crd(2)) crd(3)])
disp(‘Spherical coordinates [r phi(rad) theta(rad]:’)
disp([sqrt(crd(1)^2+crd(3)^2) crd(2) crd(3)*cos(crd(3))])
else coord_sys == ‘s’; % if not r nor c but s execute this block
disp(‘Enter the spherical coordinate in the’);
crd = input(‘format [\rho \phi \theta]... \n > ‘);
if isempty(crd); crd = [0 0 0]; end
disp(‘Rectangular coordinates [x y z]:’)
disp([crd(1)*cos(crd(2))*sin(crd(3)) ...
crd(1)*sin(crd(2))*sin(crd(3)) crd(1)*cos(crd(3))])
disp(‘Cylindrical coordinates [r phi(rad) theta(rad]:’)
disp([crd(1)*sin(crd(3)) crd(2) crd(1)*cos(crd(3))])
end
MATLAB 2.1 % This script allows the user to input a non-variable vector
% in rectangular coordinates and obtain the cylindrical, or
% spherical components. The user must also enter the point
% location where this transformation occurs; the result
SUMMARY
1. The three common coordinate systems we shall use throughout the text are the
Cartesian (or rectangular), the circular cylindrical, and the spherical.
2. A point P is represented as P 1 x, y, z 2 , P 1 r, f, z 2 , and P 1 r, u, f 2 in the Cartesian, cylin-
drical, and spherical systems, respectively. A vector field A is represented as 1 Ax, Ay, Az 2
or Axax 1 Ayay 1 Azaz in the Cartesian system, as 1 Ar, Af, Az 2 or Arar 1 Afaf 1 Azaz
in the cylindrical system, and as 1 Ar, Au, Af 2 or Arar 1 Auau 1 Afaf in the spherical
system. It is preferable that mathematical operations (addition, subtraction, product,
etc.) be performed in the same coordinate system. Thus, point and vector transforma-
tions should be performed whenever necessary. A summary of point and vector trans-
formations is given in Table 2.1.
3. Fixing one space variable defines a surface; fixing two defines a line; fixing three defines
a point.
4. A unit normal vector to surface n 5 constant is 6an.
x 5 r cos f r 5 #x2 1 y2 y
Variable sin f 5
y 5 r sin f y 2 2
change Variable f 5 tan21 a b #x 1 y
z5z change x x
cos f 5
Ap 5 Ax cos f 1 Ay sin f z 5z 2
#x 1 y
2
Component
change Af 5 2Ax sin f 1 Ay cos f x y
Az 5 Az Ax 5 Ar 2 Af
2 2 2
2
#x 1 y #x 1 y
Component y x
Ay 5 Ar 1 Af
change 2
#x 1 y
2 2
#x 1 y
2
Az 5 Az
Adopted with permission from G. F. Miner, Lines and Electromagnetic Fields for Engineers. New York: Oxford Univ. Press, 1996, p. 263.
REVIEW
QUESTIONS 2.1 The ranges of u and f as given by eq. (2.17) are not the only possible ones. The following
are all alternative ranges of u and f, except
(a) 0 # u , 2p, 0 # f # p
(b) 0 # u , 2p, 0 # f , 2p
(c) 2p # u # p, 0 # f # p
(d) 2p/2 # u # p/2, 0 # f , 2p
(e) 0 # u # p, 2p # f , p
(f) 2p # u , p, 2p # f , p