Vector Algebra and Coordinate Systems
Electromagnetics is a field theory, so most quantities have direction as well as magnitude. The electric field , magnetic field intensity , flux densities and , current density , force , and area vector are all vectors. Before differentiating or integrating fields, we need reliable notation for positions, distances, unit vectors, dot products, cross products, and coordinate transformations.
The practical reason to learn multiple coordinate systems is symmetry. A line charge is natural in cylindrical coordinates, a point charge is natural in spherical coordinates, and a rectangular waveguide is natural in Cartesian coordinates. Choosing coordinates that match the geometry usually turns a hard integral into a short calculation. This page supports the vector calculus page and connects directly to vector differential calculus.
Figure: Cylindrical coordinates fit wires, coaxial cables, waveguides, and rotational symmetry. Image: Wikimedia Commons, Svjo, CC BY-SA 3.0.
Figure: Spherical coordinates fit radiation, central forces, and three-dimensional angular structure. Image: Wikimedia Commons, SharkD, CC BY-SA 4.0.
Definitions
A vector has magnitude and direction. In Cartesian coordinates,
The dot product measures projection:
The cross product creates a vector normal to the plane of and :
Its magnitude is , and its direction follows the right-hand rule.
The position vector in Cartesian coordinates is
In cylindrical coordinates ,
In spherical coordinates , where is measured from and in the - plane,
The differential lengths are
The corresponding volume elements are
These extra factors are scale factors. Cartesian coordinates have scale factors . Cylindrical coordinates have , because moving through a small azimuthal angle traces an arc length . Spherical coordinates have , because angular motion traces arcs whose radii depend on position. Whenever an integral looks suspiciously too simple in cylindrical or spherical coordinates, the missing scale factor is the first thing to check.
Coordinate singularities are not physical singularities by themselves. At , the unit vectors and are not uniquely defined because every azimuth points to the same axis. At , spherical angular directions are undefined. A field may be perfectly finite at these locations even if the coordinate description is awkward, so distinguish coordinate artifacts from actual point sources or infinite field values.
Key results
Coordinate unit vectors in curvilinear systems depend on position. In cylindrical coordinates,
In spherical coordinates,
Distance vectors should be built carefully. If a source point is and an observation point is , the separation vector is
with magnitude and direction . Coulomb and Biot-Savart integrals repeatedly use this construction. A common error is to subtract coordinates in cylindrical or spherical form without accounting for changing unit vectors; when in doubt, convert to Cartesian components, subtract, then convert back if useful.
For areas, the vector direction is essential. Examples include
The sign of flux integrals depends on choosing the outward normal for closed surfaces or the normal specified by the right-hand rule for open surfaces bounded by a contour.
The unit-vector transformations also provide a reliable way to transform vector components. A physical vector does not change when coordinates change, but its component list does. For example, a vector in the direction has cylindrical components that vary with because
This position dependence explains why differentiating vector fields in cylindrical and spherical coordinates is more complicated than differentiating their scalar component functions.
Triple products appear often in force and power manipulations:
and
These identities are not decorative; they simplify torque, magnetic force, and Poynting vector expressions.
As a final check, every coordinate choice should preserve physical length, area, volume, and direction. If two coordinate descriptions give different distances or fluxes for the same geometry, the error is in the representation, not in the physics.
Visual
| Coordinate system | Best for | Length element | Volume element |
|---|---|---|---|
| Cartesian | planes, rectangular cavities, waveguides | ||
| Cylindrical | wires, coax, circular loops | ||
| Spherical | point charges, spheres, radiation distance |
Worked example 1: Distance vector in cylindrical coordinates
Problem: A source point is at m and an observation point is at m. Find and .
Step 1: Convert each point to Cartesian coordinates. For the observation point,
For the source point,
Step 2: Subtract coordinates:
Thus
Step 3: Compute magnitude:
Check: The vertical difference alone is m, so a total distance of m is plausible.
Worked example 2: Surface area of a spherical cap
Problem: Find the area of the spherical surface between and .
Step 1: Use the spherical area element normal to :
Step 2: Integrate over the cap:
Step 3: Evaluate the inner integral:
Step 4: Evaluate the outer integral:
Check: If , the cap is the full sphere and .
Code
import numpy as np
def cyl_to_cart(rho, phi_deg, z):
phi = np.deg2rad(phi_deg)
return np.array([rho * np.cos(phi), rho * np.sin(phi), z], dtype=float)
source = cyl_to_cart(2, 30, 1)
obs = cyl_to_cart(5, 120, 4)
R_vec = obs - source
R_mag = np.linalg.norm(R_vec)
print("source =", source)
print("observer =", obs)
print("R vector =", R_vec)
print("R magnitude =", R_mag)
Common pitfalls
- Treating , , , and as constant everywhere. They rotate with position.
- Omitting metric factors such as , , and from differential lengths, areas, or volumes.
- Using as the azimuth angle in spherical coordinates. In the convention used here, is measured down from and is azimuth.
- Forgetting that has direction. Flux signs depend on the chosen normal.
- Subtracting curvilinear coordinate triples directly to form distance vectors.
- Reversing cross-product order. .
- Assuming a coordinate transformation changes the physical vector. Only the basis and component representation change.
Connections
- Vector differential calculus for gradient, divergence, and curl.
- Vector integral calculus for line, surface, and volume integrals.
- Electrostatic fields and potential for source-to-observer vectors in Coulomb integrals.
- Magnetostatic forces and Ampere law for cross products in magnetic force and Biot-Savart law.