1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
---
title: "Spherical coordinates"
firstLetter: "S"
publishDate: 2021-03-04
categories:
- Mathematics
- Physics
date: 2021-03-04T15:05:21+01:00
draft: false
markup: pandoc
---
# Spherical coordinates
**Spherical coordinates** are an extension of polar coordinates to 3D.
The position of a given point in space is described by
three coordinates $(r, \theta, \varphi)$, defined as:
* $r$: the **radius** or **radial distance**: distance to the origin.
* $\theta$: the **elevation**, **polar angle** or **colatitude**:
angle to the positive $z$-axis, or **zenith**, i.e. the "north pole".
* $\varphi$: the **azimuth**, **azimuthal angle** or **longitude**:
angle from the positive $x$-axis, typically in the counter-clockwise sense.
Cartesian coordinates $(x, y, z)$ and the spherical system
$(r, \theta, \varphi)$ are related by:
$$\begin{aligned}
\boxed{
\begin{aligned}
x &= r \sin\theta \cos\varphi \\
y &= r \sin\theta \sin\varphi \\
z &= r \cos\theta
\end{aligned}
}
\end{aligned}$$
Conversely, a point given in $(x, y, z)$
can be converted to $(r, \theta, \varphi)$
using these formulae:
$$\begin{aligned}
\boxed{
r = \sqrt{x^2 + y^2 + z^2}
\qquad
\theta = \arccos(z / r)
\qquad
\varphi = \mathtt{atan2}(y, x)
}
\end{aligned}$$
The spherical coordinate system is an orthogonal
[curvilinear](/know/concept/curvilinear-coordinates/) system,
whose scale factors $h_r$, $h_\theta$ and $h_\varphi$ we want to find.
To do so, we calculate the differentials of the Cartesian coordinates:
$$\begin{aligned}
\dd{x} &= \dd{r} \sin\theta \cos\varphi + \dd{\theta} r \cos\theta \cos\varphi - \dd{\varphi} r \sin\theta \sin\varphi
\\
\dd{y} &= \dd{r} \sin\theta \sin\varphi + \dd{\theta} r \cos\theta \sin\varphi + \dd{\varphi} r \sin\theta \cos\varphi
\\
\dd{z} &= \dd{r} \cos\theta - \dd{\theta} r \sin\theta
\end{aligned}$$
And then we calculate the line element $\dd{\ell}^2$,
skipping many terms thanks to orthogonality:
$$\begin{aligned}
\dd{\ell}^2
&= \:\:\:\: \dd{r}^2 \big( \sin^2(\theta) \cos^2(\varphi) + \sin^2(\theta) \sin^2(\varphi) + \cos^2(\theta) \big)
\\
&\quad + \dd{\theta}^2 \big( r^2 \cos^2(\theta) \cos^2(\varphi) + r^2 \cos^2(\theta) \sin^2(\varphi) + r^2 \sin^2(\theta) \big)
\\
&\quad + \dd{\varphi}^2 \big( r^2 \sin^2(\theta) \sin^2(\varphi) + r^2 \sin^2(\theta) \cos^2(\varphi) \big)
\\
&= \dd{r}^2 + r^2 \: \dd{\theta}^2 + r^2 \sin^2(\theta) \: \dd{\varphi}^2
\end{aligned}$$
Finally, we can simply read off
the squares of the desired scale factors
$h_r^2$, $h_\theta^2$ and $h_\varphi^2$:
$$\begin{aligned}
\boxed{
h_r = 1
\qquad
h_\theta = r
\qquad
h_\varphi = r \sin\theta
}
\end{aligned}$$
With these factors, we can easily convert things from the Cartesian system
using the standard formulae for orthogonal curvilinear coordinates.
The basis vectors are:
$$\begin{aligned}
\boxed{
\begin{aligned}
\vu{e}_r
&= \sin\theta \cos\varphi \:\vu{e}_x + \sin\theta \sin\varphi \:\vu{e}_y + \cos\theta \:\vu{e}_z
\\
\vu{e}_\theta
&= \cos\theta \cos\varphi \:\vu{e}_x + \cos\theta \sin\varphi \:\vu{e}_y - \sin\theta \:\vu{e}_z
\\
\vu{e}_\varphi
&= - \sin\varphi \:\vu{e}_x + \cos\varphi \:\vu{e}_y
\end{aligned}
}
\end{aligned}$$
The basic vector operations (gradient, divergence, Laplacian and curl) are given by:
$$\begin{aligned}
\boxed{
\nabla f
= \vu{e}_r \pdv{f}{r}
+ \vu{e}_\theta \frac{1}{r} \pdv{f}{\theta} + \mathbf{e}_\varphi \frac{1}{r \sin\theta} \pdv{f}{\varphi}
}
\end{aligned}$$
$$\begin{aligned}
\boxed{
\nabla \cdot \vb{V}
= \frac{1}{r^2} \pdv{(r^2 V_r)}{r}
+ \frac{1}{r \sin\theta} \pdv{(\sin\theta V_\theta)}{\theta}
+ \frac{1}{r \sin\theta} \pdv{V_\varphi}{\varphi}
}
\end{aligned}$$
$$\begin{aligned}
\boxed{
\nabla^2 f
= \frac{1}{r^2} \pdv{r} \Big( r^2 \pdv{f}{r} \Big)
+ \frac{1}{r^2 \sin\theta} \pdv{\theta} \Big( \sin\theta \pdv{f}{\theta} \Big)
+ \frac{1}{r^2 \sin^2(\theta)} \pdv[2]{f}{\varphi}
}
\end{aligned}$$
$$\begin{aligned}
\boxed{
\begin{aligned}
\nabla \times \vb{V}
&= \frac{\vu{e}_r}{r \sin\theta} \Big( \pdv{(\sin\theta V_\varphi)}{\theta} - \pdv{V_\theta}{\varphi} \Big)
\\
&+ \frac{\vu{e}_\theta}{r} \Big( \frac{1}{\sin\theta} \pdv{V_r}{\varphi} - \pdv{(r V_\varphi)}{r} \Big)
\\
&+ \frac{\vu{e}_\varphi}{r} \Big( \pdv{(r V_\theta)}{r} - \pdv{V_r}{\theta} \Big)
\end{aligned}
}
\end{aligned}$$
The differential element of volume $\dd{V}$
takes the following form:
$$\begin{aligned}
\boxed{
\dd{V}
= r^2 \sin\theta \dd{r} \dd{\theta} \dd{\varphi}
}
\end{aligned}$$
So, for example, an integral over all of space is converted like so:
$$\begin{aligned}
\iiint_{-\infty}^\infty f(x, y, z) \dd{V}
= \int_0^{2\pi} \int_0^\pi \int_0^\infty f(r, \theta, \varphi) \: r^2 \sin\theta \dd{r} \dd{\theta} \dd{\varphi}
\end{aligned}$$
The isosurface elements are as follows, where $S_r$ is a surface at constant $r$, etc.:
$$\begin{aligned}
\boxed{
\begin{aligned}
\dd{S}_r = r^2 \sin\theta \dd{\theta} \dd{\varphi}
\qquad
\dd{S}_\theta = r \sin\theta \dd{r} \dd{\varphi}
\qquad
\dd{S}_\varphi = r \dd{r} \dd{\theta}
\end{aligned}
}
\end{aligned}$$
Similarly, the normal vector element $\dd{\vu{S}}$ for an arbitrary surface is given by:
$$\begin{aligned}
\boxed{
\dd{\vu{S}}
= \vu{e}_r \: r^2 \sin\theta \dd{\theta} \dd{\varphi}
+ \vu{e}_\theta \: r \sin\theta \dd{r} \dd{\varphi}
+ \vu{e}_\varphi \: r \dd{r} \dd{\theta}
}
\end{aligned}$$
And finally, the tangent vector element $\dd{\vu{\ell}}$ of a given curve is as follows:
$$\begin{aligned}
\boxed{
\dd{\vu{\ell}}
= \vu{e}_r \: \dd{r}
+ \vu{e}_\theta \: r \dd{\theta}
+ \vu{e}_\varphi \: r \sin\theta \dd{\varphi}
}
\end{aligned}$$
## References
1. M.L. Boas,
*Mathematical methods in the physical sciences*, 2nd edition,
Wiley.
|