Coordinate systems

This resource focuses on an introduction suitable for an introductory college physics course in electromagnetism.

We describe three different coordinate systems, known as Cartesian, cylindrical and spherical. The cylindrical system is closely related to polar coordinates.

See also /Derivation of formulas/

Cartesian Coordinate

 * Cartesian-coordinate-system.svg

Mathematical expression of a point on Cartesian coordinate
 * A (x,y)

Polar Coordinate

 * Examples_of_Polar_Coordinates.svg

Mathematical expression of a point on Cartesian coordinate
 * A (r,$$\theta$$)

Conversion Coordinate

 * Polar_to_cartesian.svg
 * $$r = \sqrt{x^2 + y^2}$$
 * $$\theta = Tan^{-} \frac{y}{x}$$
 * $$x(\theta) = r Cos \theta$$
 * $$y(\theta) = r Sin \theta$$

Cartesian Coordinates
To the left: Illustration of a Cartesian coordinate plane. Four points are marked and labeled with their coordinates: (2,&#8239;3) in green, (−3,&#8239;1) in red, (−1.5,&#8239;−2.5) in blue, and the origin (0,&#8239;0) in purple.

To the right: A three dimensional Cartesian coordinate system, with origin O and axis lines X, Y and Z, oriented as shown by the arrows. The tick marks on the axes are one length unit apart. The black dot shows the point with coordinates x = 2, y = 3, and z = 4, or (2,3,4).

Line element in Cartesian coordinates
The distance between points $$(x_1,y_1,z_1)$$ and $$(x_2,y_2,z_2)$$ is
 * $$l = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2+ (z_2-z_1)^2} .$$

In other coordinate systems, it is best to focus on the distance between two points that are close together. For our purposes, it is best to replace the above formula with:


 * $$d\ell = \sqrt{(dx)^2 + (dy)^2+ (dz)^2} =\sqrt{\vec d\ell\cdot\vec d\ell}$$

where,


 * $$\vec d\ell = \hat x dx + \hat y dy + \hat z dz $$.

is known as a line element.

Line integral of a vector field in Cartesian coordinates
So far we have discussed the integral of a scalar field, $$f=f(\vec r)$$. An example of a scalar field is the temperature as a function of position (at any given time). Wind velocity as a function of position would be a vector field. In Cartesian coordinates it is easy to analyze a vector field as being equivalent to three scalar fields, one for each direction: Let $$\vec F(\vec r) = f(\vec r)\hat i + g(\vec r)\hat j + h(\vec r)\hat k \,$$ (so that Fx=f, Fy=g, and Fz=h). The line integral of the vector field from $$\vec r = \vec a$$ to $$\vec r = \vec b$$ can now be defined as the limit of a Riemann sum:


 * $$\int_\vec{a}^\vec{b}\vec F\cdot d\vec\ell\approx\sum_j \vec{F_j}\cdot\Delta\vec\ell \equiv \sum_j F_j \ \Delta\ell \cos\theta$$

Line integral of a uniform field over a straight path
Line integrals are trivial if the vector field is uniform, meaning that the field does not depend on position. A well known example is the acceleration of gravity at Earth's surface, under the assumption that we may approximate the Earth as 'flat': $$\vec F_0 = -g\hat y$$ where g=9.8m/s2, and the 0 subscript reminds us that the field is a constant. Constant terms may be factored out of either a Riemann sum or an integral: If $$\vec F$$ does not depend on position, then:


 * $$\sum_j \vec F_j\cdot\Delta\vec\ell_j\ =\vec F\cdot\sum_j \Delta\vec\ell

\leftrightarrow \int_\vec a^\vec b \vec F\cdot d \vec\ell\,$$ $$=\vec F\cdot\int_\vec a^\vec b d\vec\ell$$

Note how the integral notation permits us to state the endpoint, $$\vec b$$ and starting point, $$\vec a$$, of the path. This can be evaluated to assume:

$$ =\int_\vec a^\vec b \vec F\cdot d \vec\ell=\vec F\cdot (\vec b -\vec a)\,$$$$=F\;|\vec b-\vec a|\cos\theta$$


 * See the Escher Waterfall to appreciate the technology that would be made possible if weight were not a conservative force.

Differential volume element in Cartesian coordinates
The Cartesian volume element is,


 * $$dV=dxdydz,$$

which easily permits a volume integral over a rectangular box. The integral of a function f=f(x,y,z) over the box is the triple integral, which is often informally written using a single integral, sign $$\int$$.


 * $$\int f\,dV=\int_{x1}^{x2}dx \overbrace{\int_{y1}^{y2}dy \underbrace{\int_{z1}^{z2}dz\,f(x,y,z)}_{\mathrm{function\ of\ x\ and\ y}}}^{\mathrm{function\ of\  x\ only}}$$

Note how the variable of integration (x or y or z) will disappear each time the integral is evaluated between the endpoints. This is a scalar integral if the function, $$f=f(x,y,z)$$. In general, the limits may be functions, for example (z1,z2) may be functions of x and y, while (y1,y2) may be functions of x. Fortunately such complexity is not required in the volume integrals needed to understand electromagnetism.

Volume integral over a rectangular box
If none of the limits, (z1,z2) and (y1,y2), in the above integral are functions, then the integral is over a rectangular box. The most elementary example of such an integral occurs when $$f(x,y,z)=1$$:


 * $$\int 1 dV=(x_2-x_1)\times(y_2-y_1)\times(z_2-z_1)\equiv \iiint 1 dV=volume$$

This is just the volume of the box.

Differential surface element in Cartesian coordinates
Surface integrals can also be viewed as the limit of a Riemann sum, but can be more difficult to construct than line or volume integrals unless the geometry is very simple. The differential element of surface area can either be a scalar, $$dA$$, or the vector element, $$d\vec A = \hat n dA$$. Here, $$\hat n$$ is normal to the surface.


 * $$\int\vec F\cdot d\vec A\approx\sum_j \vec{F_j}\cdot\Delta\vec A \equiv \sum_j (F_j)\ (\Delta A_j )\cos\theta$$

At the moment of this writing a | Wikipedia page states that a surface element in Cartesian coordiantes is,


 * $$d\vec A=dxdy\hat z + dydz\hat x + dzdx\hat y\,,$$

which is at best misleading. In practice, one learns electromagnetism by doing very simple surface integrals where only one term is present.

A surface integral over a square with its normal parallel to a Cartesian axis
The vector surface area element,


 * $$d\vec A = dA \hat n = dxdy\hat z$$

occupies rectangle parallel to the xy-plane. If the integral is of the form $$\int \vec F\cdot d\vec A$$, and the area is a square of length L centered at the origin, and occupying the plane, z=H, then:

$$\int \vec F\cdot d\vec A = \int F_zdA=\int_{-L/2}^{+L/2}dx\int_{-L/2}^{+L/2}dy F_z(x,y,H) $$

In contrast to the one-dimensional integrals of a first-year calculus course, limits are not always used to define the region over which the field is integrated. Instead it is customary to state the integral, $$\int f\,dA $$, and then use words to describe the area (e.g. "where the integral is over a square with sides of length, L, centered at the origin and occupying the xy plane"). Very simply defined surface integrals can also be defined using limits. For example,


 * $$\int \vec F\cdot\,dA =\int_{-L/2}^{L/2}dx \int_{-L/2}^{L/2}dy F_z(x,y,0)\, $$

actually does describe a surface integral over a square with sides of length, L, that occupies the xy plane, and is centered at the origin. For example, if L=4, and


 * $$F_z(x,y,z)=(1 +z)y^2\Rightarrow F_z(x,y,0)=y^2$$,

we have:


 * $$\int F_z\,dA =

\underbrace{ \int_{-4/2}^{4/2}dx  }_4 \underbrace{ \int_{-4/2}^{4/2}y^2dy  }_{(2)   \left(\frac 1 3 \right)  \left(2^3\right)   } = 4 + 16/3 = \frac{28}{3}$$

Polar coordinates
In the two-dimensional polar coordinate system, the displacement vector, $$\vec r$$ is specified by the distance to the origin, $$r$$, and the angle, $$\theta$$, measured with respect to the x-axis. The unit vectors (shown in red), $$\hat r$$ and $$\hat\theta$$ are orthonormal, but change direction as the angle changes. It is evident from the two figures that:


 * $$d\vec\ell = \hat r dr + \hat\theta rd\theta$$


 * $$d\ell = \sqrt{ (dr)^2+r^2(d\theta)^2 }=

\left[ \left(\frac{dr}{d\tau}\right)^2  + r^2 \left(\frac{d\theta}{d\tau}\right)^2    \right]^{1/2}$$


 * $$dA = rdrd\theta$$

Cylindrical coordinates


The cylindrical coordinate system specifies point positions by the symbols $$(\rho, \varphi, z)$$, as shown in the figure. The coordinate $$z$$ can be positive or negative, while $$\rho$$ is always positive. Sometimes the Greek r,$$\rho$$ (called rho), is written in Latin form, $$r$$, in order to avoid confusion with rho as charge density, and also in order to emphasize the close relationship between polar and cylindrical coordinates.

The line element is
 * $$\vec d\mathbf{\ell} = \mathrm d\rho\,\boldsymbol{\hat \rho} + \rho\,\mathrm d\varphi\,\boldsymbol{\hat\varphi} + \mathrm dz\,\mathbf{\hat z}.$$

The volume element is
 * $$\mathrm{d}V = \rho\,\mathrm{d}\rho\,\mathrm{d}\varphi\,\mathrm{d}z.$$

The surface element in a surface of constant radius $$\rho$$ (a vertical cylinder) is


 * $$\mathrm{d}S_\rho= \rho\,\mathrm{d}\varphi\,\mathrm{d}z.$$

The surface element in a surface of constant azimuth $$\varphi$$ (a vertical half-plane) is


 * $$\mathrm{d}S_\varphi= \mathrm{d}\rho\,\mathrm{d}z.$$

The surface element in a surface of constant height $$z$$ (a horizontal plane) is


 * $$\mathrm{d}S_z= \rho\,\mathrm{d}\rho\,\mathrm{d}\varphi.$$

Spherical coordinates



 * $$\mathrm{d}\vec\ell = \mathrm{d}r\,\boldsymbol{\hat r} + r\,\mathrm{d}\theta \,\boldsymbol{\hat\theta } + r \sin{\theta} \, \mathrm{d}\varphi\,\mathbf{\boldsymbol{\hat \varphi}}.$$

While three surface elements exist (one for each direction), the only one commonly used to introduce electrodynamics is in the radial direction:


 * $$\hat r dA = \hat r r^2\sin\theta\,\mathrm{d}\theta\,\mathrm{d}\varphi.$$

Recall that the radian can be defined in terms of an arclength on a circle: $$d\theta\equiv ds/r$$. By analogy, the solid angle can be defined through an area on a sphere:


 * $$\mathrm{d}\Omega\equiv\frac{dA}{r^2}=\sin\theta\,\mathrm{d}\theta\,\mathrm{d}\varphi,$$

where dA is an area element taken on the surface of a sphere of radius, r, centered at the origin.

The volume element is spherical coordinates is:


 * $$\mathrm{d}V=r^2 \sin \theta \,\mathrm{d}r\,\mathrm{d}\theta\,\mathrm{d}\varphi.$$

Introductory discussions of electromagnetism often involve spherical symmetry, in which fields do not depend on the two directional coordinates (φ and θ). This permits integration over both variables:

$$\int d\Omega = \int_0^{2\pi}d\varphi \int_0^\pi sin\theta d\theta =\int_0^{2\pi}d\varphi \int_{-1}^1 d(\cos\theta)=4\pi$$

We have just shown that the solid angle associated with a sphere is 4&pi; steradians (just as the circle is associated with 2&pi; radians).

Divergence, gradient and Laplacian (differential operators)
from https://en.wikipedia.org/w/index.php?title=Divergence&oldid=605214437

Cartesian coordinates
The del operator acting on a scalar field $$f=f(\vec r)$$ is the gradient of that field:


 * $$\vec\nabla f= \boldsymbol{\hat x}\frac{\partial f}{\partial x} + \boldsymbol{\hat y}\frac{\partial f}{\partial y} + \mathbf{\hat z}\frac{\partial f}{\partial z},$$

The divergence of a the vector field $$\vec F=\vec F(\vec r)$$ is
 * $$\operatorname{div}\, \vec F

= \vec\nabla\cdot\vec F = \frac{\partial F_x}{\partial x}+\frac{\partial F_y}{\partial y} + \frac{\partial F_z}{\partial z}\,. $$

The Laplacian $$\nabla^2$$ of a scalar field is


 * $$ \nabla^2 f =\vec\nabla\cdot\vec \nabla f

= + {\partial^2 f \over \partial x^2 } + {\partial^2 f \over \partial y^2 } + {\partial^2 f \over \partial z^2 }. $$

Cylindrical coordinates
The del operator acting on a scalar field $$f=f(\vec r)$$ is the gradient of that field:


 * $$\vec\nabla f= \boldsymbol{\hat \rho}\frac{\partial f}{\partial \rho} + \boldsymbol{\hat \varphi}\frac{1}{\rho}\frac{\partial f}{\partial \varphi} + \mathbf{\hat z}\frac{\partial f}{\partial z},$$

The divergence of a the vector field $$\vec F=\vec F(\vec r)$$ is
 * $$\operatorname{div}\, \vec F

= \vec\nabla\cdot\vec F = \frac 1\rho \frac{\partial}{\partial\rho} (\rho F_\rho) + \frac 1\rho \frac{\partial F_\varphi}{\partial\varphi} + \frac{\partial F_z}{\partial z}\,. $$

The Laplacian $$\nabla^2$$ of a scalar field is


 * $$ \nabla^2 f =\vec\nabla\cdot\vec \nabla f

= {1 \over \rho} {\partial \over \partial \rho} \left( \rho {\partial f \over \partial \rho} \right) + {1 \over \rho^2} {\partial^2 f \over \partial \varphi^2} + {\partial^2 f \over \partial z^2 }. $$

Advanced topics in vector integrals
The most well-known integrals of vector calculus are deliberately chosen to be simple because the intent is usually to depict important concepts in physics. This section describes moderately difficult geometries.

Line integral of scalar field
The most elementary line integral is along an axis. For example,


 * $$\int_{x1}^{x2} f(x, y_0, z_0)\,dx$$

is the line integral of $$f(\vec r)$$ from the point $$(x_1,y_0,z_0)$$ to $$(x_2,y_0,z_0)$$. A line an an arbitrary direction may be defined parametrically, e.g., by:


 * $$\vec r = \vec r_0 + \vec\beta \tau$$

To define scalar line integral, we need to convert the vector path differential into a scalar by taking the magnitude. It is customary to label a differential in the vector $$\vec r$$ using the symbol $$d\vec\ell$$ instead of $$d\vec r$$ because the latter falsely hints at a change in radius, as we shall soon see:


 * $$d\vec\ell \equiv d\vec r = \vec\beta d\tau\Rightarrow d\ell=\beta d\tau\;,$$

where $$\beta\equiv |\vec\beta|$$ is the vector magnitude. Writing the path differential $$\vec d\ell$$ as $$\vec dr$$ would lead to great confusion when the (scalar) magnitude is taken because $$dr\equiv |d\vec r|$$ creates a conflict with the differential in radius if spherical coordinates are used: $$dr= d|\vec r| \ne |d\vec r|$$. The scalar line integral over a scalar field, $$f=f(\vec r)$$ is therefore:


 * $$\int_{\tau 1}^{\tau 2} f(x_0+\beta_x\tau, y_0+\beta_y\tau, z_0+\beta_z\tau)\,\sqrt{\beta_x^2+\beta_y^2+\beta_z^2}\,d\tau$$

is the line integral of $$f(\vec r)$$ from the point $$(x_1,y_0,z_0)$$ to $$(x_2,y_0,z_0)$$.

If $$\beta = 1$$, the three components of $$\vec\beta$$ are the cosines that each coordinate axis (x-y-z) makes with $$\vec\beta$$. The most convenient way to express the differential line vector and scalar are:


 * $$d\vec\ell = \hat xdx + \hat ydy$$


 * $$ d\ell =\sqrt{dx^2+dy^2}=

\left[ \left(\frac{dx}{d\tau}\right)^2 + \left(\frac{dx}{d\tau}\right)^2     \right]^{1/2}d\tau$$

The vector line integral in polar coordinates
$$\vec F \cdot d\vec\ell = F_xdx+F_ydy = F_r dr + F_\theta rd\theta$$

$$\vec F \cdot d\vec\ell = \left(F_x\hat i + F_y\hat j\right)\cdot \left( \hat i dx + \hat j dy\right)$$ $$= F_x dx (\hat i\cdot \hat i) + F_y dy (\hat j\cdot \hat j) + (junk)(\hat j \cdot \hat i)$$

where $$\hat i\cdot \hat i =\hat j\cdot \hat j = 1$$ and $$\hat i\cdot\hat j = 0$$.

For polar coordinates, use $$d\vec\ell = \hat r dr + rd\theta \hat \theta$$

Appendix: Teaching the vector
The "vector" is a nontrivial concept that arises even in Riemannian calculus where an n-dimensional space of variables is defined, and the concept of metric is used to generate vector and tensor fields, all without that fundamental sense of "direction" that students use to define "vector".

A students' introduction to coordinates starts with points on a two-dimensional x-y plane. There are a number of more or less equivalent way to label these points. We begin with the displacement vector:


 * $$\vec r = x\hat i + y\hat j \rightarrow x\hat x + y\hat y\rightarrow x_1\hat e_1 + x_2\hat e_2$$

This is essentially an ordered pair of variables that represent the real numbers x and y, and the formalism is easily extended to an arbitrary number of dimensions: :$$z\hat k \rightarrow  z\hat z\rightarrow x_3\hat e_3$$

One can define the displacement vector as an instruction to move a certain distance in a certain direction. In a Euclidean space, there is no difference between specifying a location (x,y) and an instruction to step from the origin in a certain direction to the point (x,y).

One advantage that vector notation offers is the ability to use symbols to represent a vector, and subscripts to represent the components:


 * a=ax i + ay j and b=bx i + by j

This notation uses boldface instead of arrows and hats to distinguish between vectors and scalars. (In other words, a, and $$\vec a$$ are different way to express the same thing.) The scalar (physics) or scalar (mathematics) is just a fancy word for "ordinary number". For example, ax and ay are scalars that form the two components of vector a. A famous use of different symbols to represent different vectors is F=ma, which says that the vector acceleration, a, multiplied the scalar, m, equals the net force, F (the latter being a vector because it has magnitude and direction).

Wikipedia links

 * Vector calculus identities
 * Surface integral
 * Cartesian coordinates
 * Polar coordinates
 * Cylindrical cordinates
 * Cylindrical coordinate system
 * Spherical coordinate system
 * Unit vector  (Wikipedia)
 * standard basis (Wikipedia)
 * Vector Calculus

other links

 * Math.com Homepage