Skip to content
Snippets Groups Projects

Add lecture notes for coordinates

Merged Michael Wimmer requested to merge coordinates into master
Files
2
+ 392
0
---
title: Coordinates
---
# Cartesian coordinates
The most common coordinates are *Cartesian coordinates*, where we use a
number $n$ of perpendicular axes. The coordinates corresponding to these
axes are $x_j$ where $j=1, \ldots, n$.
Cartesian coordinates are simple, as the coordinate axis are simply
straight lines and perpendicular to each other. Due to this, it is
very easy to do calculations in Cartesian coordinates. For example,
the distance $\Delta s$ between two points $(x_1, x_2, \ldots, x_n)$
and $(x'_1, x'_2, \ldots, x'_n)$ is easily computed as
$$\Delta s^2 = (x'_1 - x_1)^2 + (x'_2 - x_2)^2 + \ldots + (x'_n - x_n)^2.$$
(A space with such a distance definition is called a *Euclidean
space*.)
In mathematics, we are often dealing with so-called *infinitesimally* small
distances, for example in the definition of derivatives and integrals.
In Cartesion coordinates the expressions for infinitesimal distances $ds$ and
infinitesimal volumes $dV$ are given as
$$ds = \sqrt{dx_1^2 + dx_2^2 + \ldots + dx_n^2}$$
and
$$dV = dx_1 dx_2 \ldots dx_N.$$
The formula for $dV$ also indicates that in Cartesian coordinates, the integral
over a volume can be expressed as individual integrals over all coordinate directions:
$\int dV = \idotsint dx_1 dx_2 \ldots dx_N$.
Cartesian coordinates are used a lot. They are particularly suitable for
infinite spaces or for rectangular volumes.
![image](figures/Coordinates_5_1.svg)
# Polar coordinates
## Definition
It often turns out useful to change to a different type of coordinate
system. For example, if you want to describe the vibrations of a
circular drum, polar coordinates turn out very convenient. These are
defined for a two-dimensional space (a plane). When using such
coordinates, a position on the plane is characterised by two
coordinates: the *distance* $r$ from the point to the origin and the
angle ($\varphi$). This is the angle between the line connecting the
point to the origin and the $x$-axis.
Note that each Cartesian coordinate has a *dimension* of length; in
polar coordinates, the radius $r$ has a dimension of *length*, whereas
the angular coordinate $\varphi$ is dimensionless.
![image](figures/Coordinates_7_0.svg)
In this plot you can distinguish the radial coordinate (0.2, 0.4 etc.)
from the angular one ($0^\circ$, $45^\circ$ etc.).
The plot below shows a point on a curve with the polar coordinates
$(r,\varphi)$ indicated. From this, we can see that the *Cartesian*
coordinates $(x,y)$ of the point are related to the polar ones as
follows:
$$\begin{equation} x = r \cos\varphi; \end{equation}$$
$$\begin{equation} y = r \sin \varphi.\end{equation}$$
![image](figures/Coordinates_9_0.svg)
The inverse relation is given as
$$\begin{equation} r=\sqrt{x^2 + y^2}; \label{rxy}\end{equation}$$
$$\begin{equation} \varphi=\begin{cases}
\arctan(y/x) & \text{$x>0$,}\\
\pi + \arctan(y/x) & \text{$x<0$ and $y>0$,}\\
-\pi + \arctan(y/x) & \text{$x<0$ and $y<0$.}
\end{cases} \label{phixy}\end{equation}$$
The last formula for $\varphi$ warrants a closer explanation: It is easy
to see that $\tan(\varphi)=y/x$ - but this is not a unique relation, due to
the fact that the $\tan$ has different branches. Convince yourself that
the expression above is correct for all the four sectors!
## Distances and areas
Now suppose we want to calculate the distance between two points, one
with polar coordinates $(r_1, \varphi_1)$, and the other with
$(r_2, \varphi_2)$. This looks like a difficult exercise. One possible
way to perform this is by translating the polar coordinates into
Cartesian coordinates and using the expression given above for this
distance: $$\Delta s^2 = (x_1 - x_2)^2 + (y_1 - y_2)^2,$$ so
$$\Delta s^2 = (r_1\cos\varphi_1 - r_2 \cos \varphi_2)^2 + (r_1\sin\varphi_1 - r_2 \sin \varphi_2)^2$$
which is not a very convenient expression.
If we consider two points which are *very close*, the analysis
simplifies however. We can use the geometry of the problem to find the
distance (see the figure below).
![image](figures/Coordinates_11_0.svg)
When going from point 1 to point 2, we first traverse a small circular
arc of radius $r_1$ and then we move a small distance radially outward
from $r_1$ to $r_2$. Provided the difference between the angles
$\varphi_1$ and $\varphi_2$ is (very) small, these paths are
approximately perpendicular and we can use Pythagoras’ theorem to find
the distance $d s$. Note that the arc is approximately straight –
it has a length $r_1 d \varphi$, where
$d \varphi = \varphi_2-\varphi_1$. So we have:
$$d s^2 = (d r)^2 + (arc~length)^2 = (d r)^2 + r_1^2 (d \varphi)^2 .$$
We can use the same arguments also for the area: since the different
segments are approximately perpendicular, we find the area by simply
multiplying them:
$$dA = r dr d\varphi.$$
This is an important formula to remember for integrating in polar
coordinates! The extra $r$ that appears here can be intuitively
understood: the area swept by an angle difference $d\varphi$
*increases* as we move further away from the origin.
!!! check "Example: Integrating over a circular area"
To check the area element we just derived, let us compute a simple
integral. We compute the integral over a circle with radius $r_0$
with a very simple function that equals to $1$. In this case,
we expect to get as a result the are of the region we integrate over.
We find:
$$
\int_0^{2\pi} d\varphi \int_0^{r_0} r dr =\\
2\pi \int_0^{r_0} r dr = 2 \pi \frac{1}{2} r_0^2 = \pi r_0^2,
$$
which is indeed the area of a circle with radius 0.
## Converting derivatives between coordinate systems
Often, in physics important equations involve derivatives given in terms
of Cartesian coordinates. One prominent example are equations of the form
$$\left(\frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2}\right)
f(x, y) = \ldots.$$
The derivative operator $\left(\frac{\partial^2}{\partial x^2} +
\frac{\partial^2}{\partial y^2}\right)$ is so common it has its own name:
the Laplacian (here for two-dimensional space).
Such an equation is universal, but for particular situations it might be
advantageous to use a different coordinate system, such as polar coordinates
for a system with rotational symmetry. The question then is: How does the
corresponding equation look like in a different coordinate system?
There are different ways to find the answer. Here, we will focus on
directly deriving the transformed equation through an explicit calculation
involving the chain rule for a function of several variables.
!!! info Chain rule for a multi-variable function
Let $f$ be a function of $n$ variables: $f(y_1, y_2, \ldots, y_n)$,
as well as $g_i(x_1, x_2, \ldots, x_n)$ for $i=1,2,\ldots, n$. Then
$$\frac{\partial}{\partial x_i} = \sum_{j=1}^n
\frac{\partial f}{\partial y_j} \frac{\partial g_j}{\partial x_i}$$
We start by replacing the function $f(x, y)$ by a function in polar coordinates
$f(r, \varphi)$, and ask what is $\frac{\partial}{\partial x} f(r, \varphi)$. When
we look at this expression, we need to understand what it *means* to take the derivative
of a function of $r, \varphi$ in terms of $x$?
For this, we need to realize that there are relations between the coordinate systems.
In particular, $r = r(x,y)$ and $\varphi = \varphi(x, y)$ as defined in equations
\ref{rxy} and \ref{phixy}. In fact, we have been rather sloppy in our notation above,
as the functions $f(x,y)$ and $f(r, \varphi)$ do not mean that I substitute $x=r$
and $y=\varphi$! It is more precise to state that there are two diferent
functions $f_\text{cart}(x,y)$ and $f_\text{polar}(r, \varphi)$ that are equivalent,
in the sense that
$$f_\text{cart}(x, y) = f_\text{polar}(r(x,y), \varphi(x,y))$$
In physics, we usually never write this down explicitly, but we are aware that these
are two different functions from the fact that they use different coordinates.
With this information, we can now apply the chain rule:
$$ \frac{\partial}{\partial x} f(r, \varphi) =
\frac{\partial f}{\partial r} \frac{\partial r(x, y)}{\partial x} +
\frac{\partial f}{\partial \varphi} \frac{\partial \varphi(x,y)}{\partial x}
$$
and it is now a matter of (tedious) calculus to arrive at the right result.
This is the task of exercises 3 and 4, which finally compute the Laplacian
in polar coordinates.
!!! warning Inverse function theorem
In this calculation one might be tempted to use the inverse
function theorem to compute derivatives like
$\frac{\partial \varphi}{\partial x}$ from the much simpler
$\frac{\partial x}{\partial \varphi}$. Note though that here we
are dealing with functions depending on several variables, so the
*Jacobian* has to be used (see [Wikipedia](https://en.wikipedia.org/wiki/Inverse_function_theorem)). A direct calculation is in this particular case more easy.
Note that this procedure also carries over to other coordinate systems,
although the calculations can become quite tedious. In these cases,
it's usually best to look up the correct form.
# Cylindrical coordinates
Three dimensional systems may have axial symmetry. An example is an
electrically charged wire of which we would like to calculate the
electric field, or a current-carrying wire for which we would like to
calculate the magnetic field. For such problems the most convenient
coordinates are *cylindrical coordinates*. For convenience, we choose
the symmetry-axis as the $z$-axis. Note that this can be done as we can
choose the coordinate system ourselves - this is not imposed by the
problem.
Cylindrical coordinates are defined straightforwardly: we use polar
coordinates $r$ and $\varphi$ in the $xy$ plane, and the distance $z$
along the symmetry-axis as the third coordinate. If the axis system is
chosen in physical space, we have two coordinates which have the
dimension of a distance: $r$ and $z$. The other coordinate,
$\varphi$, is of course dimensionless.
What is the distance travelled along a path when we express this in
cylindrical coordinates? Let’s consider an example (Figure).
![image](figures/Coordinates_13_0.svg)
We want to find the length of the (small) red segment $d s$. By
inspecting the figure, we see that the horizontal (i.e. parallel to the
$xy$-plane) segment $d l$ is perpendicular to the vertical segment
$dz$. Using for $d l$ the length we obtained before for a line
segment in the $xy$ plane, expressed in polar coordinates, we
immediately find:
$$d s^2 = d l^2 + d z^2 = d r^2 + r^2 d \varphi^2 + d z^2.$$
The volume element is consequently given as
$$dV = r dr d\varphi dz.$$
# Spherical coordinates
For problems with spherical symmetry, we use *spherical coordinates*.
These work as follows. For a point $\bf r$ in 3D space, we can specify
the position of that point by specifying its (1) distance to the origin
and (2) the direction of the line connecting the origin to our point.
The specification of this direction can be identified with a point on a
sphere which is centered at the origin:
![image](figures/Coordinates_15_0.svg)
The position of a point on the sphere is specified using the two angles
$\theta$ and $\phi$ indicated in the figure.
!!! warning
Note that in mathematics, often the angles are labelled the other way
round: there, $\phi$ is used for the angle between a line running from
the origin o the point of interest and the $z$-axis, and $\theta$ for
the angle of the projection of that line with the $x$-axis. The
convention used here is custom in physics.
The relation between Cartesian and coordinates is defined by
$$x = r \cos \varphi \sin \vartheta$$
$$y = r \sin\varphi \sin \vartheta$$ $$z = r \cos\vartheta$$ The inverse
transformation is easy to find: $$r = \sqrt{x^2+y^2+z^2}$$
$$\theta = \arccos(z/\sqrt{x^2+y^2+z^2})$$
$$\phi = \begin{cases} \arctan(y/x) &{\rm for ~} x>0; \\
\pi + \arctan(y/x) & {\rm for ~} x<0 {\rm ~ and ~} y>0;\\
-\pi + \arctan(y/x) &{\rm ~ for ~} x<0 {\rm ~ and ~} y<0.
\end{cases}$$ These relations can be derived from the following figure:
![image](figures/Coordinates_17_0.svg)
The distance related to a change in the spherical coordinates is
calculated using Pythagoras’ theorem. The length $ds$ of a short segment
on the sphere with radius $r$ corresponding to changes in the polar
angles of $d\vartheta$ and $d\varphi$ is given as
$$dl^2 = r^2 \left(\sin^2 \vartheta d\varphi^2 + d\vartheta^2\right).$$
In order to verify this, it is important to realize that all points with
*the same* coordinate $\vartheta$ span a circle in a horizontal plane
with a radius $r\sin\vartheta$ as shown in the figure below.
From this we can also infer that, for a segment with a radial component
$dr$ in addition to the displacement on the sphere, the displacement is:
$$ds^2 = r^2 \left(\sin^2 \vartheta d\varphi^2 + d\vartheta^2\right) + dr^2.$$
The picture below shows the geometry behind the calculation of this
displacement.
![image](figures/Coordinates_19_0.svg)
From these arguments we can again also find the volume element, it is
here given as
$$dV = r^2 \sin\theta dr d\theta d\varphi.$$
### summary
We have discussed four different coordinate systems:
1. *Cartesian coordinates*: $${\bf r} = (x_1, \ldots, x_n).$$ Can be
used for any dimension $n$. Convenient for: infinite spaces, systems
with rectangular symmatry.
Distance between two points ${\bf r} = (x_1, \ldots, x_n)$ and
${\bf r}' = (x'_1, \ldots, x'_n)$:
$$\Delta s^2 = (x'_1 - x_1)^2 + (x'_2 - x_2)^2 + \ldots + (x'_n - x_n)^2.$$
2. *Polar coordinates*: $${\bf r} = (r, \phi).$$ Can be used in two
dimensions. Suitable for systems with circular symmetry or functions
given in terms of these coordinates.
Infinitesimal distance: $$ds^2 = dr^2 + r^2 d\phi^2.$$
Infinitesimal area: $$dA = r dr d\varphi.$$
3. *Cylindrical coordinates*: $${\bf r} = (r, \phi, z).$$ Can be
used in three dimensions. Suitable for systems with axial symmetry
or functions given in terms of these coordinates.
Infinitesimal distance: $$ds^2 = dr^2 + r^2 d\phi^2 + dz^2.$$
Infinitesimal volume:: $$dV = r dr d\varphi dz.$$
4. *Spherical coordinates*: $${\bf r} = (r, \theta, \phi).$$ Can be
used in three dimensions. Suitable for systems with spherical
symmetry or functions given in terms of these coordinates.
Infinitesimal distance:
$$ds^2 =r^2 (\sin^2 \theta d\phi^2 + d\theta^2) + dr^2 .$$
Infinitesimal volume:
$$dV = r^2 \sin(\theta) dr d\theta d\varphi.$$
Problems
========
1. [:grinning:]
1. Find the polar coordinates of the point with Cartesian
coordinates $${\bf r} = \sqrt{2} (1,1).$$
2. Find the cylindrical coordinates of the point with Cartesian
coordinates $${\bf r} = \frac{3}{2} (\sqrt{3}, 1, 1).$$
3. Find the spherical coordinates of the points
$${\bf r} = (3/2, \sqrt{3}/2, 1).$$
2. [:grinning:] *Geometry and different coordinate systems}*
What geometric objects do the following boundary conditions describe?
1. $r<1$ in cylindrical coordinates,
2. $\varphi=0$ in cylindrical coordinates,
3. $r=1$ in spherical coordinates,
4. $\theta = \pi/4$ in spherical coordinates,
5. $r=1$ and $\theta=\pi/4$ in spherical coordinates.
3. [:smirk:] From the transformation from polar to Cartesian
coordinates, show that
$$\frac{\partial}{\partial x} = \cos\varphi \frac{\partial}{\partial r} - \frac{\sin\varphi}{r} \frac{\partial}{\partial \varphi}$$
and
$$\frac{\partial}{\partial y} = \sin\varphi \frac{\partial}{\partial r} + \frac{\cos\varphi}{r} \frac{\partial}{\partial \varphi}.$$
(Use the chain rule for differentiation).
3. [:sweat:] Using the result of problem 2, show that the Laplace
operator acting on a function $\psi({\bf r})$ in polar coordinates
takes the form
$$\nabla^2 \psi({\bf r}) =\left( \frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2}\right) \psi({\bf r}) = \frac{1}{r} \frac{\partial}{\partial r} \left( r \frac{\partial \psi(r,\varphi)}{\partial r} \right) + \frac{1}{r^2} \frac{\partial^2 \psi(r,\varphi)}{\partial \varphi^2}.$$
In a similar fashion it can be shown that for spherical coordinates,
the Laplace operator acting on a function $\psi({\bf r})$ becomes:
$$\nabla^2 \psi (r,\vartheta,\varphi) =
\frac{1}{r^2} \frac{\partial}{\partial r^2} \left( r^2 \frac{\partial \psi(r,\vartheta,\varphi)}{\partial r} \right) + \frac{1}{r^2\sin^2\vartheta} \frac{\partial^2 \psi(r,\vartheta, \varphi)}{\partial \varphi^2} + \frac{1}{r^2\sin\vartheta}
\frac{\partial}{\partial \vartheta}\left( \sin\vartheta \frac{\partial\psi(r,\vartheta, \varphi)}{\partial \vartheta}\right).$$
This is however even more tedious (you do not have to show this).
5. [:grinning:] *Integration and coordinates I*
Compute the area of the spherical cap defined by $r=r_0$ and $\theta <\theta_0$.
6. [:smirk:] *Integration and coordinates II*
In 2D we can define a shape by specifying a function $r(\varphi)$:
![image](figures/shape_polar.svg)
(Of course, here we need to have $r(0) = r(2\pi)$.)
Show that the area of this shape is given by
$$
\int_0^{2\pi} \frac{1}{2}\left[r(\varphi)\right]^2 d\varphi
$$
Loading