<?xml version="1.0" encoding="UTF-8"?>

<record version="1" id="1566">
 <title>Vectors, Fields, and Coordinate Geometry</title>
 <name>VectorsFieldsAndCoordinateGeometry</name>
 <created>2026-11-02 01:09:25</created>
 <modified>2026-11-02 01:09:25</modified>
 <type>Topic</type>
 <creator id="1" name="bloftin"/>
 <modifier id="1" name="bloftin"/>
 <comment>removed the defines as there are better articles defining these items and it seems to suppress the link to them</comment>
 <author id="1" name="bloftin"/>
 <classification>
	<category scheme="pacs" code="02.30.Em"/>
	<category scheme="pacs" code="02.40.-k"/>
	<category scheme="pacs" code="03.50.De"/>
 </classification>
 <defines>
	<concept>vector</concept>
	<concept>scalar</concept>
	<concept>vector component</concept>
	<concept>basis vector</concept>
	<concept>orthonormal basis</concept>
	<concept>dot product</concept>
	<concept>vector projection</concept>
	<concept>cross product</concept>
	<concept>scalar triple product</concept>
	<concept>vector triple product</concept>
	<concept>position vector</concept>
	<concept>displacement vector</concept>
	<concept>scalar field</concept>
	<concept>vector field</concept>
	<concept>coordinate curve</concept>
	<concept>scale factor</concept>
	<concept>orthogonal curvilinear coordinate</concept>
	<concept>cylindrical coordinates</concept>
	<concept>spherical coordinates</concept>
	<concept>differential line element</concept>
	<concept>differential area element</concept>
	<concept>differential volume element</concept>
 </defines>
 <synonyms>
	<synonym concept="Vectors, Fields, and Coordinate Geometry" alias="ED02"/>
 </synonyms>
 <keywords>
	<term>vectors</term>
	<term>vector fields</term>
	<term>coordinate systems</term>
	<term>basis vectors</term>
	<term>dot product</term>
	<term>cross product</term>
	<term>cylindrical coordinates</term>
	<term>spherical coordinates</term>
	<term>scale factors</term>
	<term>differential elements</term>
	<term>electrodynamics</term>
 </keywords>
 <preamble>% this is the default PhysicsLibrary preamble.  as your knowledge
% of TeX increases, you will probably want to edit this, but
% it should be fine as is for beginners.

% almost certainly you want these
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}

% used for TeXing text within eps files
%\usepackage{psfrag}
% need this for including graphics (\includegraphics).
% If you use \includegraphics{figure} with no file extension, PhysicsLibrary
% will prefer figure.png before falling back to figure.eps.
\usepackage{graphicx}
\DeclareGraphicsExtensions{.png,.jpg,.jpeg,.pdf,.eps}
% for neatly defining theorems and propositions
%\usepackage{amsthm}
% making logically defined graphics
%\usepackage{xypic}

% there are many more packages, add them here as you need them

% define commands here</preamble>
 <content>\section*{ED02: Vectors, Fields, and Coordinate Geometry}

Electrodynamics is written in the language of vector fields.  Before deriving Coulomb's law, Gauss's law, the Biot-Savart law, or Maxwell's equations in detail, we need a precise geometric language for direction, magnitude, components, position, and spatial variation.

The central lesson of this article is that a vector is not the same thing as its list of components.  The vector is the geometric object.  Components are the numbers used to describe that object relative to a chosen basis.

That distinction becomes especially important in cylindrical and spherical coordinates, where the basis directions themselves change from point to point.

This article therefore develops the coordinate geometry that later electrodynamics will repeatedly use:

\begin{itemize}
\item vectors and scalars,
\item basis vectors and components,
\item dot and cross products,
\item position and displacement vectors,
\item scalar and vector fields,
\item orthogonal curvilinear coordinates,
\item scale factors,
\item Cartesian, cylindrical, and spherical bases,
\item and differential line, area, and volume elements.
\end{itemize}

Gradient, divergence, and curl are intentionally deferred to ED03.  Here the emphasis is the geometry from which those operators will later be derived.

\begin{center}
\includegraphics[width=0.92\textwidth,keepaspectratio]{ED02_fig01_vector_components.png}

{\small Figure 1. A geometric vector is independent of the coordinate description used to represent it.  Once a basis is chosen, the vector can be decomposed into components along the basis directions.}
\end{center}

\section{Scalars and vectors}

A scalar is a quantity specified by a magnitude, possibly with units, but without an intrinsic spatial direction.

Examples include

\begin{equation}
q,
\qquad
m,
\qquad
T,
\qquad
V,
\qquad
\rho.
\end{equation}

A vector has both magnitude and direction.

Examples include

\begin{equation}
\mathbf r,
\qquad
\mathbf v,
\qquad
\mathbf E,
\qquad
\mathbf B,
\qquad
\mathbf J.
\end{equation}

A geometric vector can be represented by a directed line segment.  If $\mathbf A$ is a vector, its magnitude is written

\begin{equation}
A=|\mathbf A|.
\end{equation}

The zero vector has zero magnitude:

\begin{equation}
\mathbf 0.
\end{equation}

Unlike an ordinary number, a vector cannot in general be characterized by magnitude alone.

\section{Vectors versus components}

Choose an orthonormal Cartesian basis

\begin{equation}
\hat{\mathbf x},
\qquad
\hat{\mathbf y},
\qquad
\hat{\mathbf z}.
\end{equation}

Any vector $\mathbf A$ can be written

\begin{equation}
\mathbf A
=
A_x\hat{\mathbf x}
+
A_y\hat{\mathbf y}
+
A_z\hat{\mathbf z}.
\label{eq:cartesian_vector_expansion}
\end{equation}

The numbers

\begin{equation}
A_x,
\qquad
A_y,
\qquad
A_z
\end{equation}

are the components of $\mathbf A$ in that basis.

If we rotate the coordinate axes, the vector itself does not change, but the components generally do.

This is a fundamental distinction:

\begin{equation}
\text{vector}
\ne
\text{particular list of components}.
\end{equation}

The same physical electric field can therefore have different component triples in different coordinate systems while representing the same field at the same physical point.

\subsection*{Magnitude from components}

Because the Cartesian basis is orthonormal,

\begin{equation}
\hat{\mathbf x}\cdot\hat{\mathbf x}=1,
\qquad
\hat{\mathbf x}\cdot\hat{\mathbf y}=0,
\end{equation}

with analogous relations for the other basis vectors.

Therefore

\begin{equation}
A^2
=
A_x^2+A_y^2+A_z^2,
\end{equation}

so

\begin{equation}
A
=
\sqrt{A_x^2+A_y^2+A_z^2}.
\end{equation}

\section{Vector addition and scalar multiplication}

If

\begin{equation}
\mathbf A
=
A_x\hat{\mathbf x}
+A_y\hat{\mathbf y}
+A_z\hat{\mathbf z}
\end{equation}

and

\begin{equation}
\mathbf B
=
B_x\hat{\mathbf x}
+B_y\hat{\mathbf y}
+B_z\hat{\mathbf z},
\end{equation}

then

\begin{equation}
\mathbf A+\mathbf B
=
(A_x+B_x)\hat{\mathbf x}
+
(A_y+B_y)\hat{\mathbf y}
+
(A_z+B_z)\hat{\mathbf z}.
\end{equation}

For scalar $c$,

\begin{equation}
c\mathbf A
=
(cA_x)\hat{\mathbf x}
+
(cA_y)\hat{\mathbf y}
+
(cA_z)\hat{\mathbf z}.
\end{equation}

Vector addition is geometric.  Components make the calculation convenient, but the parallelogram or head-to-tail rule gives the underlying geometric meaning.

\section{The dot product}

For vectors $\mathbf A$ and $\mathbf B$ separated by angle $\theta$,

\begin{equation}
\mathbf A\cdot\mathbf B
=
AB\cos\theta.
\label{eq:dot_geometric}
\end{equation}

The dot product produces a scalar.

In an orthonormal Cartesian basis,

\begin{equation}
\mathbf A\cdot\mathbf B
=
A_xB_x+A_yB_y+A_zB_z.
\end{equation}

\begin{center}
\includegraphics[width=0.91\textwidth,keepaspectratio]{ED02_fig02_dot_cross_geometry.png}

{\small Figure 2. The dot product measures parallel alignment through a projection, while the cross product measures oriented perpendicular content through the area of the parallelogram spanned by the two vectors.}
\end{center}

\subsection*{Projection}

The scalar component of $\mathbf A$ along $\mathbf B$ is

\begin{equation}
A_{\parallel B}
=
\mathbf A\cdot\hat{\mathbf B},
\end{equation}

where

\begin{equation}
\hat{\mathbf B}
=
\frac{\mathbf B}{B}.
\end{equation}

The corresponding vector projection is

\begin{equation}
\mathbf A_{\parallel B}
=
(\mathbf A\cdot\hat{\mathbf B})\hat{\mathbf B}.
\end{equation}

Equivalently,

\begin{equation}
\mathbf A_{\parallel B}
=
\frac{\mathbf A\cdot\mathbf B}{B^2}\mathbf B.
\end{equation}

This same projection idea will later appear in electric flux, magnetic flux, work, boundary conditions, polarization, and wave decomposition.

\subsection*{Orthogonality}

If two nonzero vectors are perpendicular,

\begin{equation}
\theta=90^\circ,
\end{equation}

then

\begin{equation}
\mathbf A\cdot\mathbf B=0.
\end{equation}

Thus the dot product is an algebraic test for orthogonality.

\section{The cross product}

The cross product is defined geometrically by

\begin{equation}
|\mathbf A\times\mathbf B|
=
AB\sin\theta,
\end{equation}

with direction perpendicular to the plane containing $\mathbf A$ and $\mathbf B$ according to the right-hand rule.

Thus

\begin{equation}
\mathbf A\times\mathbf B
=
AB\sin\theta\,\hat{\mathbf n},
\end{equation}

where $\hat{\mathbf n}$ is the oriented unit normal.

The order matters:

\begin{equation}
\mathbf A\times\mathbf B
=
-\mathbf B\times\mathbf A.
\end{equation}

For a right-handed Cartesian basis,

\begin{align}
\hat{\mathbf x}\times\hat{\mathbf y}&amp;=\hat{\mathbf z},\\
\hat{\mathbf y}\times\hat{\mathbf z}&amp;=\hat{\mathbf x},\\
\hat{\mathbf z}\times\hat{\mathbf x}&amp;=\hat{\mathbf y}.
\end{align}

Reversing any pair changes the sign.

\subsection*{Cartesian component form}

Expanding bilinearly gives

\begin{align}
\mathbf A\times\mathbf B
={}&amp;
(A_yB_z-A_zB_y)\hat{\mathbf x}
\\
&amp;+
(A_zB_x-A_xB_z)\hat{\mathbf y}
\\
&amp;+
(A_xB_y-A_yB_x)\hat{\mathbf z}.
\end{align}

This expression should not obscure the geometric meaning: the cross product represents oriented area and a normal direction.

\section{Triple products}

The scalar triple product is

\begin{equation}
\mathbf A\cdot(\mathbf B\times\mathbf C).
\end{equation}

Its magnitude equals the volume of the parallelepiped generated by the three vectors.

Cyclic permutations leave it unchanged:

\begin{equation}
\mathbf A\cdot(\mathbf B\times\mathbf C)
=
\mathbf B\cdot(\mathbf C\times\mathbf A)
=
\mathbf C\cdot(\mathbf A\times\mathbf B).
\end{equation}

Interchanging two vectors reverses the sign.

The vector triple product satisfies

\begin{equation}
\mathbf A\times(\mathbf B\times\mathbf C)
=
\mathbf B(\mathbf A\cdot\mathbf C)
-
\mathbf C(\mathbf A\cdot\mathbf B).
\label{eq:bac_cab}
\end{equation}

Equation~\eqref{eq:bac_cab} is often remembered as the BAC-CAB identity, but it is safer to recognize its structural form: the result lies in the plane spanned by $\mathbf B$ and $\mathbf C$.

\section{Position and displacement vectors}

Choose an origin $O$.

The position vector of point $P$ is

\begin{equation}
\mathbf r
=
\overrightarrow{OP}.
\end{equation}

In Cartesian coordinates,

\begin{equation}
\mathbf r
=
x\hat{\mathbf x}
+y\hat{\mathbf y}
+z\hat{\mathbf z}.
\label{eq:cartesian_position}
\end{equation}

If a second point has position $\mathbf r'$, the displacement from the source point $\mathbf r'$ to the field point $\mathbf r$ is

\begin{equation}
\mathbf R
=
\mathbf r-\mathbf r'.
\label{eq:source_field_displacement}
\end{equation}

Its magnitude is

\begin{equation}
R=|\mathbf r-\mathbf r'|.
\end{equation}

The corresponding unit vector is

\begin{equation}
\hat{\mathbf R}
=
\frac{\mathbf r-\mathbf r'}{|\mathbf r-\mathbf r'|}.
\end{equation}

This source-to-field-point geometry will appear constantly in Coulomb, Biot-Savart, Green-function, multipole, and radiation integrals.

\begin{center}
\includegraphics[width=0.91\textwidth,keepaspectratio]{ED02_fig03_position_displacement_field.png}

{\small Figure 3. Position and displacement geometry.  Electrodynamics repeatedly distinguishes the source point $\mathbf r'$ from the field point $\mathbf r$.  The relative vector $\mathbf R=\mathbf r-\mathbf r'$ points from source to observation point.}
\end{center}

\section{A vector field is not one vector}

A vector field assigns a vector to each point in space:

\begin{equation}
\mathbf F
=
\mathbf F(\mathbf r).
\end{equation}

If time dependence is included,

\begin{equation}
\mathbf F
=
\mathbf F(\mathbf r,t).
\end{equation}

For example,

\begin{equation}
\mathbf E(\mathbf r)
\end{equation}

means that every spatial point has its own electric-field vector.

A scalar field instead assigns one scalar value to each point:

\begin{equation}
V=V(\mathbf r).
\end{equation}

Electric potential is a scalar field; electric field is a vector field.

This difference becomes important in EDL03.  A potential map consists of measured scalar values $V(x,y)$ on a grid.  From spatial variation of that scalar field we will later infer a vector field $\mathbf E$.

\section{Coordinate systems as geometric maps}

A coordinate system assigns numbers to spatial points.

In Cartesian coordinates,

\begin{equation}
(x,y,z)
\end{equation}

labels a point.

In cylindrical coordinates,

\begin{equation}
(s,\phi,z)
\end{equation}

labels the same physical space.

In spherical coordinates,

\begin{equation}
(r,\theta,\phi)
\end{equation}

provides another labeling.

The coordinate system is not the physical space itself.  It is a description adapted to geometry and symmetry.

This is why coordinate choice matters in electrodynamics.  A spherical charge distribution is usually easiest in spherical coordinates, a long straight wire in cylindrical coordinates, and a rectangular electrode arrangement in Cartesian coordinates.

\section{General orthogonal curvilinear coordinates}

Let three coordinates be

\begin{equation}
q_1,
\qquad
q_2,
\qquad
q_3.
\end{equation}

The position vector is a function

\begin{equation}
\mathbf r
=
\mathbf r(q_1,q_2,q_3).
\label{eq:general_position_map}
\end{equation}

Hold $q_2$ and $q_3$ fixed while varying $q_1$.  This traces a coordinate curve.

The tangent to that curve is

\begin{equation}
\frac{\partial\mathbf r}{\partial q_1}.
\end{equation}

Similarly,

\begin{equation}
\frac{\partial\mathbf r}{\partial q_2},
\qquad
\frac{\partial\mathbf r}{\partial q_3}
\end{equation}

point along the other coordinate curves.

Define the scale factors

\begin{equation}
h_i
=
\left|
\frac{\partial\mathbf r}{\partial q_i}
\right|.
\label{eq:scale_factor_definition}
\end{equation}

Then the corresponding unit vectors are

\begin{equation}
\hat{\mathbf e}_i
=
\frac{1}{h_i}
\frac{\partial\mathbf r}{\partial q_i}.
\label{eq:unit_basis_general}
\end{equation}

For an orthogonal coordinate system,

\begin{equation}
\hat{\mathbf e}_i\cdot\hat{\mathbf e}_j=0
\qquad
(i\ne j).
\end{equation}

\begin{center}
\includegraphics[width=0.91\textwidth,keepaspectratio]{ED02_fig04_general_coordinates.png}

{\small Figure 4. General orthogonal coordinates.  Varying one coordinate while holding the others fixed traces a coordinate curve.  The derivative of the position vector along that curve gives a tangent direction and its magnitude defines the scale factor $h_i$.}
\end{center}

\section{Deriving the differential line element}

Differentiate Equation~\eqref{eq:general_position_map}:

\begin{equation}
d\mathbf r
=
\frac{\partial\mathbf r}{\partial q_1}dq_1
+
\frac{\partial\mathbf r}{\partial q_2}dq_2
+
\frac{\partial\mathbf r}{\partial q_3}dq_3.
\end{equation}

Using Equations~\eqref{eq:scale_factor_definition} and \eqref{eq:unit_basis_general},

\begin{equation}
d\mathbf r
=
h_1dq_1\hat{\mathbf e}_1
+h_2dq_2\hat{\mathbf e}_2
+h_3dq_3\hat{\mathbf e}_3.
\label{eq:general_dr}
\end{equation}

For orthogonal coordinates,

\begin{equation}
ds^2
=
d\mathbf r\cdot d\mathbf r
=
h_1^2dq_1^2
+h_2^2dq_2^2
+h_3^2dq_3^2.
\label{eq:metric_orthogonal}
\end{equation}

The scale factors therefore convert coordinate increments into physical lengths.

This interpretation is crucial.  A change $d\phi$ is an angle, not a physical distance.  The corresponding physical arc length depends on where the point is located.

\section{Differential area elements}

Consider a small surface on which $q_1$ is constant.

The two tangent edge vectors are

\begin{equation}
d\mathbf l_2
=
h_2dq_2\hat{\mathbf e}_2
\end{equation}

and

\begin{equation}
d\mathbf l_3
=
h_3dq_3\hat{\mathbf e}_3.
\end{equation}

Their cross product gives the oriented area element:

\begin{equation}
d\mathbf a_1
=
d\mathbf l_2\times d\mathbf l_3.
\end{equation}

For a right-handed orthogonal basis,

\begin{equation}
d\mathbf a_1
=
h_2h_3\,dq_2dq_3\,\hat{\mathbf e}_1.
\label{eq:general_area_1}
\end{equation}

Cyclically,

\begin{align}
d\mathbf a_2
&amp;=
h_3h_1\,dq_3dq_1\,\hat{\mathbf e}_2,\\
d\mathbf a_3
&amp;=
h_1h_2\,dq_1dq_2\,\hat{\mathbf e}_3.
\end{align}

These formulas will later become the geometric foundation of electric and magnetic flux integrals.

\section{Differential volume element}

The small coordinate cell has edge lengths

\begin{equation}
h_1dq_1,
\qquad
h_2dq_2,
\qquad
h_3dq_3.
\end{equation}

Therefore its differential volume is

\begin{equation}
d\tau
=
h_1h_2h_3\,dq_1dq_2dq_3.
\label{eq:general_volume_element}
\end{equation}

This is the origin of factors such as

\begin{equation}
s
\end{equation}

in cylindrical volume elements and

\begin{equation}
r^2\sin\theta
\end{equation}

in spherical volume elements.  They are geometric scale factors, not arbitrary memorized corrections.

\begin{center}
\includegraphics[width=0.92\textwidth,keepaspectratio]{ED02_fig05_differential_elements.png}

{\small Figure 5. Differential line, area, and volume elements are built from the physical edge lengths of an infinitesimal coordinate cell.  The scale factors encode how coordinate increments become actual distances.}
\end{center}

\section{Cartesian coordinates derived from the general construction}

The Cartesian position vector is

\begin{equation}
\mathbf r(x,y,z)
=
x\hat{\mathbf x}
+y\hat{\mathbf y}
+z\hat{\mathbf z}.
\end{equation}

Therefore

\begin{equation}
\frac{\partial\mathbf r}{\partial x}
=
\hat{\mathbf x},
\end{equation}

\begin{equation}
\frac{\partial\mathbf r}{\partial y}
=
\hat{\mathbf y},
\end{equation}

and

\begin{equation}
\frac{\partial\mathbf r}{\partial z}
=
\hat{\mathbf z}.
\end{equation}

Hence

\begin{equation}
h_x=h_y=h_z=1.
\end{equation}

Thus

\begin{equation}
d\mathbf r
=
dx\hat{\mathbf x}
+dy\hat{\mathbf y}
+dz\hat{\mathbf z},
\end{equation}

and

\begin{equation}
d\tau
=
dx\,dy\,dz.
\end{equation}

The Cartesian basis vectors are spatially constant:

\begin{equation}
\frac{\partial\hat{\mathbf x}}{\partial x}
=
\frac{\partial\hat{\mathbf x}}{\partial y}
=
\frac{\partial\hat{\mathbf x}}{\partial z}
=
\mathbf 0,
\end{equation}

with analogous results for $\hat{\mathbf y}$ and $\hat{\mathbf z}$.

This simplicity is special.  It does not hold for cylindrical or spherical unit vectors.

\section{Cylindrical coordinates}

Use cylindrical coordinates

\begin{equation}
(s,\phi,z),
\end{equation}

where $s$ is distance from the $z$ axis, $\phi$ is azimuthal angle, and $z$ is the usual Cartesian height.

The coordinate transformation is

\begin{align}
x&amp;=s\cos\phi,\\
y&amp;=s\sin\phi,\\
z&amp;=z.
\end{align}

Therefore

\begin{equation}
\mathbf r
=
s\cos\phi\,\hat{\mathbf x}
+s\sin\phi\,\hat{\mathbf y}
+z\hat{\mathbf z}.
\label{eq:cyl_position}
\end{equation}

Differentiate with respect to $s$:

\begin{equation}
\frac{\partial\mathbf r}{\partial s}
=
\cos\phi\,\hat{\mathbf x}
+
\sin\phi\,\hat{\mathbf y}.
\end{equation}

Its magnitude is unity, so

\begin{equation}
h_s=1
\end{equation}

and

\begin{equation}
\hat{\mathbf s}
=
\cos\phi\,\hat{\mathbf x}
+
\sin\phi\,\hat{\mathbf y}.
\label{eq:cyl_es}
\end{equation}

Differentiate Equation~\eqref{eq:cyl_position} with respect to $\phi$:

\begin{equation}
\frac{\partial\mathbf r}{\partial\phi}
=
-s\sin\phi\,\hat{\mathbf x}
+s\cos\phi\,\hat{\mathbf y}.
\end{equation}

Its magnitude is

\begin{equation}
h_\phi=s.
\end{equation}

Therefore

\begin{equation}
\hat{\boldsymbol\phi}
=
-\sin\phi\,\hat{\mathbf x}
+
\cos\phi\,\hat{\mathbf y}.
\label{eq:cyl_ephi}
\end{equation}

Finally,

\begin{equation}
\frac{\partial\mathbf r}{\partial z}
=
\hat{\mathbf z},
\end{equation}

so

\begin{equation}
h_z=1.
\end{equation}

Thus the cylindrical scale factors are

\begin{equation}
h_s=1,
\qquad
h_\phi=s,
\qquad
h_z=1.
\label{eq:cyl_scale_factors}
\end{equation}

\begin{center}
\includegraphics[width=0.91\textwidth,keepaspectratio]{ED02_fig06_cylindrical_geometry.png}

{\small Figure 6. Cylindrical coordinates.  The radial direction $\hat{\mathbf s}$ and azimuthal direction $\hat{\boldsymbol\phi}$ rotate with position.  An angular increment $d\phi$ corresponds to physical arc length $s\,d\phi$.}
\end{center}

\subsection*{Cylindrical line element}

Substituting Equation~\eqref{eq:cyl_scale_factors} into Equation~\eqref{eq:general_dr},

\begin{equation}
d\mathbf r
=
ds\,\hat{\mathbf s}
+s\,d\phi\,\hat{\boldsymbol\phi}
+dz\,\hat{\mathbf z}.
\label{eq:cyl_dr}
\end{equation}

The scalar distance element is

\begin{equation}
dl^2
=
ds^2+s^2d\phi^2+dz^2.
\end{equation}

\subsection*{Cylindrical area elements}

For a surface of constant $s$,

\begin{equation}
d\mathbf a_s
=
s\,d\phi\,dz\,\hat{\mathbf s}.
\end{equation}

For a surface of constant $\phi$,

\begin{equation}
d\mathbf a_\phi
=
ds\,dz\,\hat{\boldsymbol\phi}.
\end{equation}

For a surface of constant $z$,

\begin{equation}
d\mathbf a_z
=
s\,ds\,d\phi\,\hat{\mathbf z}.
\end{equation}

\subsection*{Cylindrical volume element}

Using Equation~\eqref{eq:general_volume_element},

\begin{equation}
d\tau
=
s\,ds\,d\phi\,dz.
\label{eq:cyl_volume}
\end{equation}

The factor $s$ appears because an angular step $d\phi$ spans a longer physical distance at larger radius.

\section{The cylindrical basis changes with position}

Differentiate Equation~\eqref{eq:cyl_es} with respect to $\phi$:

\begin{equation}
\frac{\partial\hat{\mathbf s}}{\partial\phi}
=
-\sin\phi\,\hat{\mathbf x}
+
\cos\phi\,\hat{\mathbf y}
=
\hat{\boldsymbol\phi}.
\end{equation}

Similarly,

\begin{equation}
\frac{\partial\hat{\boldsymbol\phi}}{\partial\phi}
=
-\cos\phi\,\hat{\mathbf x}
-\sin\phi\,\hat{\mathbf y}
=
-\hat{\mathbf s}.
\end{equation}

Therefore a vector field can vary even when its cylindrical components appear numerically constant.

For example,

\begin{equation}
\mathbf F=F_0\hat{\mathbf s}
\end{equation}

has constant radial component $F_0$, but the direction of the vector changes around the axis.

This basis variation is one of the main reasons divergence and curl formulas contain geometry-dependent terms in curvilinear coordinates.

\begin{center}
\includegraphics[width=0.90\textwidth,keepaspectratio]{ED02_fig07_basis_variation.png}

{\small Figure 7. Basis-vector variation.  Cartesian basis vectors keep the same direction everywhere, while cylindrical and spherical basis vectors rotate as the observation point moves.  Curvilinear components cannot be differentiated as though the basis were constant.}
\end{center}

\section{Spherical coordinates}

Use spherical coordinates

\begin{equation}
(r,\theta,\phi),
\end{equation}

with $r$ radial distance, $\theta$ polar angle measured from $+z$, and $\phi$ azimuthal angle about the $z$ axis.

The coordinate transformation is

\begin{align}
x&amp;=r\sin\theta\cos\phi,\\
y&amp;=r\sin\theta\sin\phi,\\
z&amp;=r\cos\theta.
\end{align}

Hence

\begin{align}
\mathbf r
={}&amp;
r\sin\theta\cos\phi\,\hat{\mathbf x}
+
r\sin\theta\sin\phi\,\hat{\mathbf y}
\\
&amp;+
r\cos\theta\,\hat{\mathbf z}.
\label{eq:sph_position}
\end{align}

Differentiate with respect to $r$:

\begin{align}
\frac{\partial\mathbf r}{\partial r}
={}&amp;
\sin\theta\cos\phi\,\hat{\mathbf x}
+
\sin\theta\sin\phi\,\hat{\mathbf y}
\\
&amp;+
\cos\theta\,\hat{\mathbf z}.
\end{align}

Its magnitude is unity, so

\begin{equation}
h_r=1
\end{equation}

and

\begin{align}
\hat{\mathbf r}
={}&amp;
\sin\theta\cos\phi\,\hat{\mathbf x}
+
\sin\theta\sin\phi\,\hat{\mathbf y}
\\
&amp;+
\cos\theta\,\hat{\mathbf z}.
\end{align}

Differentiate Equation~\eqref{eq:sph_position} with respect to $\theta$:

\begin{align}
\frac{\partial\mathbf r}{\partial\theta}
={}&amp;
r\cos\theta\cos\phi\,\hat{\mathbf x}
+
r\cos\theta\sin\phi\,\hat{\mathbf y}
\\
&amp;-
r\sin\theta\,\hat{\mathbf z}.
\end{align}

Its magnitude is $r$, so

\begin{equation}
h_\theta=r
\end{equation}

and

\begin{align}
\hat{\boldsymbol\theta}
={}&amp;
\cos\theta\cos\phi\,\hat{\mathbf x}
+
\cos\theta\sin\phi\,\hat{\mathbf y}
\\
&amp;-
\sin\theta\,\hat{\mathbf z}.
\end{align}

Finally,

\begin{align}
\frac{\partial\mathbf r}{\partial\phi}
={}&amp;
-r\sin\theta\sin\phi\,\hat{\mathbf x}
\\
&amp;+
r\sin\theta\cos\phi\,\hat{\mathbf y}.
\end{align}

Its magnitude is

\begin{equation}
h_\phi=r\sin\theta.
\end{equation}

Therefore

\begin{equation}
\hat{\boldsymbol\phi}
=
-\sin\phi\,\hat{\mathbf x}
+
\cos\phi\,\hat{\mathbf y}.
\end{equation}

The spherical scale factors are therefore

\begin{equation}
h_r=1,
\qquad
h_\theta=r,
\qquad
h_\phi=r\sin\theta.
\label{eq:sph_scale_factors}
\end{equation}

\begin{center}
\includegraphics[width=0.91\textwidth,keepaspectratio]{ED02_fig08_spherical_geometry.png}

{\small Figure 8. Spherical coordinates.  At fixed radius, changing $\theta$ moves along a meridian with physical length $r\,d\theta$, while changing $\phi$ moves along a latitude circle with physical length $r\sin\theta\,d\phi$.}
\end{center}

\subsection*{Spherical line element}

Using Equation~\eqref{eq:sph_scale_factors},

\begin{equation}
d\mathbf r
=
dr\,\hat{\mathbf r}
+r\,d\theta\,\hat{\boldsymbol\theta}
+r\sin\theta\,d\phi\,\hat{\boldsymbol\phi}.
\label{eq:sph_dr}
\end{equation}

Thus

\begin{equation}
dl^2
=
dr^2+r^2d\theta^2+r^2\sin^2\theta\,d\phi^2.
\end{equation}

\subsection*{Spherical area elements}

At constant $r$,

\begin{equation}
d\mathbf a_r
=
r^2\sin\theta\,d\theta\,d\phi\,\hat{\mathbf r}.
\label{eq:sphere_area}
\end{equation}

At constant $\theta$,

\begin{equation}
d\mathbf a_\theta
=
r\sin\theta\,dr\,d\phi\,\hat{\boldsymbol\theta}.
\end{equation}

At constant $\phi$,

\begin{equation}
d\mathbf a_\phi
=
r\,dr\,d\theta\,\hat{\boldsymbol\phi}.
\end{equation}

\subsection*{Spherical volume element}

The differential volume is

\begin{equation}
d\tau
=
r^2\sin\theta\,dr\,d\theta\,d\phi.
\label{eq:sph_volume}
\end{equation}

The factor $r^2\sin\theta$ follows directly from the three physical edge lengths

\begin{equation}
dr,
\qquad
r\,d\theta,
\qquad
r\sin\theta\,d\phi.
\end{equation}

\section{Coordinate singularities are descriptive, not necessarily physical}

Cylindrical coordinates become singular on the axis

\begin{equation}
s=0,
\end{equation}

because the azimuthal angle $\phi$ becomes undefined there.

Spherical coordinates become singular at

\begin{equation}
r=0
\end{equation}

and along the polar axis where

\begin{equation}
\sin\theta=0.
\end{equation}

A coordinate singularity does not automatically indicate a physical singularity.

For example, a perfectly finite uniform electric field can be expressed in spherical components that have awkward angular behavior near the poles.  The underlying physical field may remain smooth even when the coordinate description becomes degenerate.

This distinction will become important when interpreting field singularities near point charges versus harmless singularities introduced by coordinate choice.

\section{Electrodynamics examples of symmetry-adapted coordinates}

Coordinate systems are most powerful when they match the symmetry of the source.

\subsection*{Point charge}

A point charge at the origin produces an electric field whose direction is radial:

\begin{equation}
\mathbf E
=
E(r)\hat{\mathbf r}.
\end{equation}

Spherical coordinates expose this symmetry immediately.

\subsection*{Infinite line charge}

For an ideal line charge along the $z$ axis,

\begin{equation}
\mathbf E
=
E(s)\hat{\mathbf s}.
\end{equation}

Cylindrical coordinates make the radial dependence explicit.

\subsection*{Long straight current}

For an ideal current along the $z$ axis, the magnetic field circles the wire:

\begin{equation}
\mathbf B
=
B(s)\hat{\boldsymbol\phi}.
\end{equation}

Again, cylindrical coordinates align with the field geometry.

\subsection*{Parallel plates}

Between large ideal parallel plates with negligible edge effects,

\begin{equation}
\mathbf E
=
E(z)\hat{\mathbf z}.
\end{equation}

Cartesian coordinates are natural.

\begin{center}
\includegraphics[width=0.93\textwidth,keepaspectratio]{ED02_fig09_symmetry_coordinate_choice.png}

{\small Figure 9. Coordinate choice should follow physical symmetry.  Planar systems naturally suggest Cartesian coordinates, axial systems cylindrical coordinates, and point-centered systems spherical coordinates.}
\end{center}

\section{Worked example 1: components of a vector}

Let

\begin{equation}
\mathbf A
=
3\hat{\mathbf x}
+4\hat{\mathbf y}
+12\hat{\mathbf z}.
\end{equation}

Its magnitude is

\begin{align}
A
&amp;=
\sqrt{3^2+4^2+12^2}\\
&amp;=
13.
\end{align}

The unit vector in the direction of $\mathbf A$ is

\begin{equation}
\hat{\mathbf A}
=
\frac{3}{13}\hat{\mathbf x}
+
\frac{4}{13}\hat{\mathbf y}
+
\frac{12}{13}\hat{\mathbf z}.
\end{equation}

If

\begin{equation}
\mathbf B
=
\hat{\mathbf x},
\end{equation}

then the scalar component of $\mathbf A$ along $\mathbf B$ is simply

\begin{equation}
\mathbf A\cdot\hat{\mathbf x}=3.
\end{equation}

\section{Worked example 2: source-to-field displacement}

Let the source point be

\begin{equation}
\mathbf r'
=
(1,2,0)\,\mathrm{m}
\end{equation}

and the observation point be

\begin{equation}
\mathbf r
=
(4,6,3)\,\mathrm{m}.
\end{equation}

Then

\begin{equation}
\mathbf R
=
\mathbf r-\mathbf r'
=
(3,4,3)\,\mathrm{m}.
\end{equation}

Its magnitude is

\begin{equation}
R
=
\sqrt{3^2+4^2+3^2}
=
\sqrt{34}\,\mathrm{m}.
\end{equation}

Therefore

\begin{equation}
\hat{\mathbf R}
=
\frac{3\hat{\mathbf x}+4\hat{\mathbf y}+3\hat{\mathbf z}}
{\sqrt{34}}.
\end{equation}

This exact geometric construction appears in the field integral of a continuous charge distribution.

\section{Worked example 3: cylindrical basis at a specific point}

Consider the point

\begin{equation}
\phi=60^\circ.
\end{equation}

Then

\begin{align}
\hat{\mathbf s}
&amp;=
\cos60^\circ\,\hat{\mathbf x}
+
\sin60^\circ\,\hat{\mathbf y}\\
&amp;=
\frac12\hat{\mathbf x}
+
\frac{\sqrt3}{2}\hat{\mathbf y},
\end{align}

while

\begin{align}
\hat{\boldsymbol\phi}
&amp;=
-\sin60^\circ\,\hat{\mathbf x}
+
\cos60^\circ\,\hat{\mathbf y}\\
&amp;=
-\frac{\sqrt3}{2}\hat{\mathbf x}
+
\frac12\hat{\mathbf y}.
\end{align}

The basis is orthonormal:

\begin{equation}
\hat{\mathbf s}\cdot\hat{\boldsymbol\phi}=0.
\end{equation}

At a different azimuth, the numerical Cartesian components of the cylindrical unit vectors change even though the coordinate names remain $\hat{\mathbf s}$ and $\hat{\boldsymbol\phi}$.

\section{Worked example 4: area of a spherical patch}

At fixed radius $r$, consider a small patch spanning angular increments $d\theta$ and $d\phi$.

The meridional edge length is

\begin{equation}
dl_\theta=r\,d\theta.
\end{equation}

The azimuthal edge length is

\begin{equation}
dl_\phi=r\sin\theta\,d\phi.
\end{equation}

Therefore the patch area is

\begin{align}
da
&amp;=
dl_\theta dl_\phi\\
&amp;=
r^2\sin\theta\,d\theta\,d\phi.
\end{align}

The corresponding outward vector area is

\begin{equation}
d\mathbf a
=
r^2\sin\theta\,d\theta\,d\phi\,\hat{\mathbf r}.
\end{equation}

This is exactly the area element that will be used in spherical electric-flux calculations.

\section{Bridge to the EDL laboratory series}

The coordinate geometry developed here is directly measurable.

In EDL03, a potential map may be sampled on a rectangular grid:

\begin{equation}
V(x_i,y_j).
\end{equation}

The grid is a Cartesian coordinate description of the physical conducting sheet.

Later experiments may map magnetic fields around a wire or coil.  Those measurements often become clearer when replotted against cylindrical radius $s$ or axial coordinate $z$.

The important experimental lesson is that a coordinate system is part of the data model.

When recording a field measurement, one should specify

\begin{itemize}
\item where the sensor is located,
\item what coordinate system describes that location,
\item which direction the sensor measures,
\item and which basis is used to report the measured components.
\end{itemize}

A Hall probe that reports one scalar channel is not directly measuring an entire vector $\mathbf B$.  It is measuring a component of $\mathbf B$ along the probe's sensitive axis.

Likewise, a potential probe measures a scalar $V$, not a vector field.

The distinction between field, component, coordinate, and instrument orientation is therefore experimentally important, not merely mathematical bookkeeping.

\section{Coordinate-choice workflow}

For an electrodynamics problem:

\begin{enumerate}
\item Identify the physical symmetry of the source and boundaries.
\item Decide which coordinate surfaces naturally follow that geometry.
\item Write the position vector in those coordinates.
\item Derive or recall the basis vectors and scale factors.
\item Construct the needed differential line, area, or volume element.
\item Express the field components in the local basis.
\item Only then perform the integral or differential operation.
\end{enumerate}

This procedure reduces memorization and makes later formulas easier to reconstruct.

\section{Common mistakes}

\begin{enumerate}
\item Treating a vector and its components as the same object.
\item Forgetting that curvilinear basis vectors vary with position.
\item Using $d\phi$ as though it were a physical length rather than an angle.
\item Omitting the factor $s$ from cylindrical area or volume elements.
\item Omitting $r^2\sin\theta$ from spherical volume elements.
\item Measuring spherical polar angle $\theta$ from the $xy$ plane rather than from the $+z$ axis when using the Griffiths convention.
\item Confusing the source coordinate $\mathbf r'$ with the field coordinate $\mathbf r$.
\item Interpreting a coordinate singularity as automatically implying a physical singularity.
\item Using a convenient coordinate system that does not respect the symmetry and then hiding the physics under unnecessary algebra.
\item Differentiating curvilinear vector components while silently treating the basis as constant.
\end{enumerate}

\section{Practice exercises}

\begin{enumerate}
\item For $\mathbf A=2\hat{\mathbf x}-3\hat{\mathbf y}+6\hat{\mathbf z}$, find $A$ and $\hat{\mathbf A}$.
\item For $\mathbf A=\hat{\mathbf x}+2\hat{\mathbf y}$ and $\mathbf B=3\hat{\mathbf x}-\hat{\mathbf y}$, compute $\mathbf A\cdot\mathbf B$ and the angle between them.
\item For the same vectors, compute $\mathbf A\times\mathbf B$ and interpret its direction.
\item Prove that $\mathbf A\cdot(\mathbf B\times\mathbf C)$ changes sign when any two vectors are exchanged.
\item Starting from Equation~\eqref{eq:cyl_position}, rederive $\hat{\mathbf s}$ and $\hat{\boldsymbol\phi}$.
\item Show explicitly that $\hat{\mathbf s}\cdot\hat{\boldsymbol\phi}=0$.
\item Starting from Equation~\eqref{eq:sph_position}, derive $h_r$, $h_\theta$, and $h_\phi$.
\item Derive the cylindrical volume element from the product of physical edge lengths.
\item Derive the spherical volume element from the three spherical scale factors.
\item Explain why $r\sin\theta\,d\phi$ becomes small near the poles even when $d\phi$ is fixed.
\item Write the Cartesian vector $\hat{\mathbf x}$ in the cylindrical basis at arbitrary $\phi$.
\item Show that a radial cylindrical vector field $F_0\hat{\mathbf s}$ changes direction with $\phi$ even though its radial component is constant.
\item For a point charge at the origin, explain why spherical coordinates are symmetry adapted before using any field equation.
\item For an infinite straight wire along $z$, explain why $\hat{\boldsymbol\phi}$ is the natural magnetic-field direction.
\item Design a coordinate table for an EDL magnetic-field mapping experiment around a straight current-carrying wire.
\end{enumerate}

\section{Companion files}

Two compact reference files accompany this article in the PhysicsLibrary filebox.

\begin{itemize}
\item \PMlinktofile{Download the ED02 coordinate-geometry summary}{ED02_coordinate_geometry_summary.csv}
\item \PMlinktofile{Download the ED02 vector-products summary}{ED02_vector_products_summary.csv}
\end{itemize}

These are intended as quick references while solving later ED and EDL problems.

\section{Summary}

A vector is a geometric object whose components depend on the chosen basis:

\begin{equation}
\mathbf A
=
\sum_i A_i\hat{\mathbf e}_i.
\end{equation}

The dot product measures parallel alignment:

\begin{equation}
\mathbf A\cdot\mathbf B
=
AB\cos\theta.
\end{equation}

The cross product measures oriented perpendicular content:

\begin{equation}
|\mathbf A\times\mathbf B|
=
AB\sin\theta.
\end{equation}

For general orthogonal coordinates,

\begin{equation}
h_i
=
\left|
\frac{\partial\mathbf r}{\partial q_i}
\right|,
\end{equation}

and

\begin{equation}
d\mathbf r
=
\sum_i h_i dq_i\hat{\mathbf e}_i.
\end{equation}

The volume element is

\begin{equation}
d\tau
=
h_1h_2h_3\,dq_1dq_2dq_3.
\end{equation}

For cylindrical coordinates,

\begin{equation}
(h_s,h_\phi,h_z)
=
(1,s,1),
\end{equation}

while for spherical coordinates,

\begin{equation}
(h_r,h_\theta,h_\phi)
=
(1,r,r\sin\theta).
\end{equation}

These geometric results are the foundation from which ED03 will derive gradient, divergence, curl, and the Laplacian rather than treating those operators as formulas to memorize.

\section*{References}

\begin{thebibliography}{9}

\bibitem{Griffiths2023}
D. J. Griffiths,
\textit{Introduction to Electrodynamics}, 5th ed.,
Cambridge University Press, 2023.

\bibitem{PurcellMorin2013}
E. M. Purcell and D. J. Morin,
\textit{Electricity and Magnetism}, 3rd ed.,
Cambridge University Press, 2013.

\bibitem{Schey2005}
H. M. Schey,
\textit{Div, Grad, Curl, and All That}, 4th ed.,
W. W. Norton, 2005.

\bibitem{Arfken2013}
G. B. Arfken, H. J. Weber, and F. E. Harris,
\textit{Mathematical Methods for Physicists}, 7th ed.,
Academic Press, 2013.

\bibitem{Boas2006}
M. L. Boas,
\textit{Mathematical Methods in the Physical Sciences}, 3rd ed.,
Wiley, 2006.

\end{thebibliography}</content>
</record>
