Part 1 · Chapter 2

Coordinate Systems and Transformation

A field doesn't care which axes we draw, but our equations do. Choosing the coordinate system that matches a problem's symmetry — Cartesian for boxes, cylindrical for wires, spherical for charges — turns a hard integral into an easy one.

Electromagnetic Field Theory Prof. Mithun Mondal Reading time ≈ 50 min
i What you'll learn
  • Why we use three coordinate systems and how to match the system to the symmetry of a problem.
  • The variables, ranges and base unit vectors of the Cartesian, cylindrical and spherical systems.
  • Why cylindrical and spherical base vectors change direction from point to point.
  • The differential length, surface and volume elements in each system.
  • How to transform a point and how to transform a vector between systems.
  • The dot-product matrices that make vector transformation mechanical.
Section 2-1

Why Coordinate Systems

A point in space and the field at that point exist independently of how we label them. But to compute anything we must attach numbers, and the numbers come from a coordinate system. The art of electromagnetics is choosing the system whose surfaces follow the problem's symmetry, so that the field depends on as few variables as possible.

Three orthogonal systems cover almost every undergraduate problem. The Cartesian \((x,y,z)\) system suits rectangular geometries. The circular cylindrical \((\rho,\phi,z)\) system suits straight wires, coaxial cables and solenoids. The spherical \((r,\theta,\phi)\) system suits point charges and radiating antennas. All three are right-handed and mutually orthogonal: their three base vectors are perpendicular at every point.

The payoff of symmetry. A point charge produces a field that points radially and depends only on \(r\). In spherical coordinates that is a one-variable problem; forced into Cartesian coordinates the very same field becomes a tangle of \(x\), \(y\) and \(z\). Same physics — far harder algebra. Pick the system first.
Section 2-2

The Cartesian System

The Cartesian (rectangular) system uses three coordinates \((x,y,z)\), each ranging over \(-\infty < x,y,z < \infty\). Its base vectors \(\hat{a}_x,\ \hat{a}_y,\ \hat{a}_z\) are constant — the same direction everywhere — which is exactly why it is the simplest system to differentiate in. A vector is written

Vector in Cartesian form
\[ \vec{A} = A_x\,\hat{a}_x + A_y\,\hat{a}_y + A_z\,\hat{a}_z, \qquad \hat{a}_x\times\hat{a}_y = \hat{a}_z \]
Section 2-3

The Circular Cylindrical System

The cylindrical system describes a point by its distance \(\rho\) from the \(z\)-axis, the azimuthal angle \(\phi\) measured from the \(x\)-axis, and the height \(z\). The ranges are \(0\le\rho<\infty\), \(0\le\phi<2\pi\), \(-\inftyswing around as \(\phi\) changes, so they are not constant.

x z y ρ P(ρ,φ,z) z φ
Cylindrical coordinates: radius ρ, azimuth φ, and height z

The link to Cartesian coordinates comes straight from the right triangle in the \(xy\)-plane:

Cylindrical ↔ Cartesian
\[ x = \rho\cos\phi,\quad y = \rho\sin\phi,\quad z = z; \qquad \rho = \sqrt{x^2+y^2},\quad \phi = \tan^{-1}\!\frac{y}{x} \]
Section 2-4

The Spherical System

The spherical system uses the radial distance \(r\) from the origin, the polar angle \(\theta\) measured down from the \(z\)-axis, and the same azimuthal angle \(\phi\) as the cylindrical system. The ranges are \(0\le r<\infty\), \(0\le\theta\le\pi\), \(0\le\phi<2\pi\). The base vectors satisfy \(\hat{a}_r\times\hat{a}_\theta = \hat{a}_\phi\), and all three change direction from point to point.

x z y r P(r,θ,φ) θ
Spherical coordinates: radius r, polar angle θ, azimuth φ

The transformation to Cartesian coordinates projects \(r\) first onto the \(z\)-axis and then onto the \(xy\)-plane:

Spherical ↔ Cartesian
\[ x = r\sin\theta\cos\phi,\quad y = r\sin\theta\sin\phi,\quad z = r\cos\theta \]
Inverse relations
\[ r = \sqrt{x^2+y^2+z^2},\quad \theta = \cos^{-1}\!\frac{z}{\sqrt{x^2+y^2+z^2}},\quad \phi = \tan^{-1}\!\frac{y}{x} \]
Section 2-5

Differential Elements

To integrate a field — to compute charge, flux, or work — we need the differential length \(d\vec{l}\), differential surface \(d\vec{S}\), and differential volume \(dv\) in each system. These follow from how far a point moves when each coordinate is nudged. Note the metric factors \(\rho\), \(r\) and \(r\sin\theta\) that appear because an angular step sweeps a longer arc the farther out you are.

Differential length
\[ \begin{aligned} \text{Cartesian:}\;\; & d\vec{l} = dx\,\hat{a}_x + dy\,\hat{a}_y + dz\,\hat{a}_z \\ \text{Cylindrical:}\;\; & d\vec{l} = d\rho\,\hat{a}_\rho + \rho\,d\phi\,\hat{a}_\phi + dz\,\hat{a}_z \\ \text{Spherical:}\;\; & d\vec{l} = dr\,\hat{a}_r + r\,d\theta\,\hat{a}_\theta + r\sin\theta\,d\phi\,\hat{a}_\phi \end{aligned} \]
Differential volume
\[ dv_{\text{cart}} = dx\,dy\,dz, \qquad dv_{\text{cyl}} = \rho\,d\rho\,d\phi\,dz, \qquad dv_{\text{sph}} = r^2\sin\theta\,dr\,d\theta\,d\phi \]
🔑
Surface elements come from pairing the length terms
\[ dS_\rho = \rho\,d\phi\,dz,\qquad dS_r = r^2\sin\theta\,d\theta\,d\phi \]

Any \(d\vec{S}\) is the product of the two \(d\vec{l}\) components that span the surface, directed along the third (normal) base vector. Hold one coordinate fixed and multiply the other two length terms — that is the whole rule.

Section 2-6

Point & Vector Transformations

Transforming a point just means plugging its coordinates into the relations above. Transforming a vector is subtler: the components change because the base vectors point in different directions. The clean way is to project each old component onto each new base vector using dot products. For Cartesian ↔ cylindrical:

Vector transformation (Cartesian → cylindrical)
\[ \begin{bmatrix} A_\rho \\ A_\phi \\ A_z \end{bmatrix} = \begin{bmatrix} \cos\phi & \sin\phi & 0 \\ -\sin\phi & \cos\phi & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} A_x \\ A_y \\ A_z \end{bmatrix} \]

Each entry of the matrix is a dot product between an old and a new base vector, for example \(A_\rho = \vec{A}\cdot\hat{a}_\rho = A_x\cos\phi + A_y\sin\phi\). The reverse transformation uses the transpose of this matrix, because the systems are orthonormal. The Cartesian ↔ spherical matrix is built the same way:

Vector transformation (Cartesian → spherical)
\[ \begin{bmatrix} A_r \\ A_\theta \\ A_\phi \end{bmatrix} = \begin{bmatrix} \sin\theta\cos\phi & \sin\theta\sin\phi & \cos\theta \\ \cos\theta\cos\phi & \cos\theta\sin\phi & -\sin\theta \\ -\sin\phi & \cos\phi & 0 \end{bmatrix} \begin{bmatrix} A_x \\ A_y \\ A_z \end{bmatrix} \]
Two steps, never one. To convert a vector field, transform the components with the dot-product matrix and rewrite any \(x,y,z\) inside those components in the new variables. Skipping the second step is the most common mistake in this chapter — a "converted" field still secretly written in \(x\) and \(y\) is not converted at all.
Section 2-7

Worked Examples

1 Point: Cartesian → cylindrical

Problem. Express \(P(3,4,5)\) in cylindrical coordinates.

Solution. Apply \(\rho=\sqrt{x^2+y^2}\) and \(\phi=\tan^{-1}(y/x)\):

Working
\[ \rho = \sqrt{9+16} = 5,\quad \phi = \tan^{-1}\tfrac{4}{3} = 53.13^\circ,\quad z = 5 \]
2 Point: Cartesian → spherical

Problem. Express \(P(1,1,\sqrt{2})\) in spherical coordinates.

Solution. Use \(r=\sqrt{x^2+y^2+z^2}\), then \(\theta\) and \(\phi\):

Working
\[ r = \sqrt{1+1+2}=2,\quad \theta=\cos^{-1}\tfrac{\sqrt2}{2}=45^\circ,\quad \phi=\tan^{-1}\tfrac{1}{1}=45^\circ \]
3 Vector: Cartesian → cylindrical

Problem. Transform \(\vec{A} = y\,\hat{a}_x - x\,\hat{a}_y\) to cylindrical components.

Solution. Apply the matrix with \(A_x=y=\rho\sin\phi\), \(A_y=-x=-\rho\cos\phi\):

Working
\[ A_\rho = A_x\cos\phi + A_y\sin\phi = 0, \qquad A_\phi = -A_x\sin\phi + A_y\cos\phi = -\rho \]

So \(\vec{A} = -\rho\,\hat{a}_\phi\) — a purely circulating field, far simpler than its Cartesian form.

4 Differential volume of a cylinder

Problem. Find the volume of a cylinder of radius \(a\) and height \(h\) by integration.

Solution. Integrate \(dv = \rho\,d\rho\,d\phi\,dz\):

Working
\[ V = \int_0^h\!\!\int_0^{2\pi}\!\!\int_0^a \rho\,d\rho\,d\phi\,dz = \tfrac{a^2}{2}\,(2\pi)\,h = \pi a^2 h \]
5 Surface area of a sphere

Problem. Find the surface area of a sphere of radius \(a\) using \(dS_r\).

Solution. Integrate \(dS_r = a^2\sin\theta\,d\theta\,d\phi\) over the full sphere:

Working
\[ S = \int_0^{2\pi}\!\!\int_0^{\pi} a^2\sin\theta\,d\theta\,d\phi = a^2(2\pi)(2) = 4\pi a^2 \]
6 Vector at a point: spherical → Cartesian

Problem. Convert \(\vec{B} = \hat{a}_r\) evaluated at \(P\) where \(\theta=90^\circ,\ \phi=0^\circ\) to Cartesian.

Solution. At this point \(\hat{a}_r\) lies in the \(xy\)-plane along \(+x\):

Working
\[ \hat{a}_r = \sin\theta\cos\phi\,\hat{a}_x + \sin\theta\sin\phi\,\hat{a}_y + \cos\theta\,\hat{a}_z = \hat{a}_x \]
Review

Chapter Summary

Three systems

Cartesian \((x,y,z)\) for boxes, cylindrical \((\rho,\phi,z)\) for wires, spherical \((r,\theta,\phi)\) for point charges.

Base vectors

All right-handed and orthogonal; only the Cartesian set is constant — the others rotate point to point.

Cyl ↔ Cart

\(x=\rho\cos\phi,\ y=\rho\sin\phi,\ z=z\); \(\rho=\sqrt{x^2+y^2}\).

Sph ↔ Cart

\(x=r\sin\theta\cos\phi,\ y=r\sin\theta\sin\phi,\ z=r\cos\theta\).

Volume elements

\(dv = dx\,dy\,dz = \rho\,d\rho\,d\phi\,dz = r^2\sin\theta\,dr\,d\theta\,d\phi\).

Vector transform

Dot-product matrix on the components, then rewrite the variables; reverse uses the transpose.

Practice

Problems

Decide first whether each item asks you to move a point or a vector, and which symmetry is involved, then apply the matching relation. Difficulty rises down the list.

  1. Convert \(P(-2,6,3)\) from Cartesian to cylindrical coordinates.
  2. Convert \(P(2,-2,1)\) from Cartesian to spherical coordinates.
  3. Convert the cylindrical point \((\rho,\phi,z)=(4,120^\circ,-1)\) to Cartesian coordinates.
  4. Convert the spherical point \((r,\theta,\phi)=(5,30^\circ,60^\circ)\) to Cartesian coordinates.
  5. State the differential length, surface and volume elements in all three systems from memory.
  6. Transform \(\vec{A} = x\,\hat{a}_x + y\,\hat{a}_y + z\,\hat{a}_z\) into spherical components and simplify.
  7. Transform \(\vec{B} = \rho\,\hat{a}_\phi\) into Cartesian components.
  8. Use integration to find the volume of a hollow cylinder with inner radius \(a\), outer radius \(b\), height \(h\).
  9. Find the area of the spherical cap \(0\le\theta\le 60^\circ\) on a sphere of radius \(a\).
  10. Express \(\vec{C} = \hat{a}_r\) (spherical) in cylindrical components.
  11. Show that the Cartesian → cylindrical transformation matrix is orthogonal (its inverse equals its transpose).
  12. A field is \(\vec{F} = \dfrac{1}{r^2}\,\hat{a}_r\). Argue why spherical coordinates make its flux through a sphere trivial, and compute that flux.
Tip: always read the symmetry before the numbers. Straight-wire or coaxial geometry whispers cylindrical; a point source or anything radiating outward whispers spherical; a rectangular slab or capacitor whispers Cartesian. Choosing the right system here is what makes the integrals in Parts 2–3 collapse to a single variable.