Vector Algebra & Coordinate Systems
The mathematical building blocks for every equation in electromagnetics
Every law in electromagnetics — Gauss's law, Ampere's law, Faraday's law — is written in the language of vectors. Before we can describe a single electric or magnetic field, we need to be fluent in vector algebra and comfortable working in three coordinate systems.
Why Vectors Matter in Electromagnetics
Electromagnetic fields are inherently vector quantities — they have a magnitude (how strong the field is) and a direction (which way a test charge would be pushed). This means every equation we encounter in this course will involve vectors. Unlike scalar quantities such as temperature or mass, which are fully described by a single number, fields like the electric field E require three components to specify completely.
Fortunately, the vector algebra needed for EM is a small, well-defined toolkit. If you can add vectors, take dot products, take cross products, and switch between coordinate systems, you have the machinery to read and manipulate Maxwell's equations themselves. This lesson refreshes those skills and introduces the three coordinate systems we will use throughout the course.
Vector Notation and Basic Operations
A vector A in three-dimensional space is written in terms of its components along the three Cartesian axes: A = Axx̂ + Ayŷ + Azẑ. Here x̂, ŷ, and ẑ are unit vectors — vectors of length 1 pointing along the x, y, and z axes respectively. The scalars Ax, Ay, Az are the components. The magnitude (or norm) of A is |A| = √(Ax² + Ay² + Az²).
Vector addition and subtraction are performed component by component. If A = 2x̂ + 3ŷ + 1ẑ and B = 1x̂ − 1ŷ + 2ẑ, then A + B = (2+1)x̂ + (3−1)ŷ + (1+2)ẑ = 3x̂ + 2ŷ + 3ẑ. Scalar multiplication scales every component: 2A = 4x̂ + 6ŷ + 2ẑ. These operations are straightforward but appear constantly — whenever we superpose fields from multiple sources, we are just adding vectors.
Throughout this course, x̂, ŷ, ẑ will always denote the Cartesian unit vectors. In cylindrical coordinates we will use ρ̂, φ̂, ẑ, and in spherical coordinates r̂, θ̂, φ̂. The hat (^) symbol always signals a unit vector.
The Dot Product (Scalar Product)
The dot product (also called the scalar product) takes two vectors and returns a single scalar. The geometric definition is A·B = |A||B|cosθ, where θ is the angle between the two vectors. This tells us the dot product measures how much two vectors point in the same direction — it is zero when they are perpendicular and maximized when they are parallel.
In component form, the dot product is far more practical for computation: A·B = AxBx + AyBy + AzBz. Just multiply corresponding components and sum. The dot product is commutative and distributes over addition. In EM, the dot product appears whenever we compute the component of a field along a direction — for instance, the electric flux through a surface depends on E·n̂, the dot product of the field with the surface normal.
- Identify the components: Ax = 2, Ay = 3, Az = 1 and Bx = 1, By = −1, Bz = 2.
- Apply the component formula: A · B = AxBx + AyBy + AzBz.
- Substitute: A · B = (2)(1) + (3)(−1) + (1)(2).
- Compute each term: A · B = 2 − 3 + 2 = 1.
The result is a positive scalar, meaning the angle between A and B is acute (less than 90°). The vectors are more aligned than opposed. If the dot product were zero, the vectors would be perpendicular; if negative, they would point in generally opposite directions.
The Cross Product (Vector Product)
The cross product takes two vectors and returns a new vector that is perpendicular to both. Its magnitude is |A×B| = |A||B|sinθ, and the direction is given by the right-hand rule: point your fingers in the direction of A, curl them toward B, and your thumb points in the direction of A×B.
In component form, the cross product is computed as a 3×3 determinant. Expanding along the first row gives: (AyBz − AzBy)x̂ − (AxBz − AzBx)ŷ + (AxBy − AyBx)ẑ. The cross product is not commutative: A×B = −(B×A). In EM, the cross product appears in the Lorentz force law (F = qv×B) and in the definition of the Poynting vector, among many other places.
When expanding the determinant, the middle term (the ŷ component) carries a minus sign. This is the most common arithmetic mistake in cross-product calculations. Always double-check: the pattern is +, −, + for the x̂, ŷ, ẑ terms respectively.
Coordinate Systems for Electromagnetics
Many problems in electromagnetics have natural symmetry, and choosing the right coordinate system can turn an intractable problem into a straightforward one. We will use three systems throughout this course.
Cartesian coordinates (x, y, z) are the default; unit vectors x̂, ŷ, ẑ are constant everywhere. Cylindrical coordinates (ρ, φ, z) are ideal for problems with symmetry about an axis — infinitely long wires, coaxial cables, cylindrical capacitors. Here ρ is the radial distance from the z-axis, φ is the azimuthal angle measured from the x-axis, and z is the same as in Cartesian. Spherical coordinates (r, θ, φ) are used for problems with symmetry about a point — point charges, spheres, dipoles. Here r is the distance from the origin, θ is the polar angle measured from the z-axis, and φ is the same azimuthal angle as in cylindrical.
A Concrete Coordinate Conversion
To see how Cartesian-to-cylindrical conversion works in practice, consider the point (x, y, z) = (3, 4, 0). The radial distance is ρ = √(3² + 4²) = √25 = 5. The azimuthal angle is φ = atan2(4, 3) ≈ 53.13°. The z-coordinate carries over unchanged: z = 0. So in cylindrical coordinates, this point is (ρ, φ, z) = (5, 53.13°, 0). Notice that ρ is always non-negative, and atan2 automatically places the angle in the correct quadrant — unlike a simple arctan(y/x), which loses quadrant information.
If a problem involves an infinite line of charge, cylindrical coordinates will simplify the math dramatically. If it involves a point charge, spherical coordinates are the natural choice. If there is no particular symmetry, Cartesian is fine. Matching the coordinate system to the geometry is one of the most important problem-solving skills in EM.
- Identify components: Ax = 1, Ay = 2, Az = 3 and Bx = 4, By = −2, Bz = 1.
- Apply the component formula: A · B = (1)(4) + (2)(−2) + (3)(1).
- Compute: A · B = 4 − 4 + 3 = 3.
Check your understanding
- Vectors have magnitude and direction, expressed as A = Axx̂ + Ayŷ + Azẑ; addition and scalar multiplication are performed component by component.
- The dot product A · B = |A||B|cosθ = AxBx + AyBy + AzBz returns a scalar measuring alignment between two vectors; it is zero for perpendicular vectors.
- The cross product A × B returns a vector perpendicular to both inputs, with magnitude |A||B|sinθ and direction given by the right-hand rule; it is anticommutative.
- Cartesian (x,y,z), cylindrical (ρ,φ,z), and spherical (r,θ,φ) coordinate systems each match different symmetries; converting from Cartesian to cylindrical uses ρ = √(x²+y²), φ = atan2(y,x), z = z.