Unit vectors and scale factors
In any coordinate system there is a concept of distance, which is
independent of the choice of coordinate system. In Cartesian coordinates
this is
\[\dif{s}^2 = \dif{x}^2 + \dif{y}^2 + \dif{z}^2 = \dif{r}\cdot
\dif{r}\]
where \(\dif{r}\) is the inifinitessimal line element.
Consider a general coordinate system described by \(q_i\), related
to Cartesian coordinates via
\[x_i = f_i (q_1, q_2, q_3)\]
As \(q_i\) is changed the position vector \(\vec r\) will move:
\[ \begin{align}\begin{aligned}\frac{\partial \vec r}{\partial q_i} = h_{q_i} \vec{e}_{q_i}\\The magnitude of :math:`\frac{\partial \vec r}{\partial q_i}` is the\end{aligned}\end{align} \]
scale factor, \(h_{q_i}\), and the basis vector is the unit vector
in the direction of \(\frac{\partial \vec r}{\partial q_i}\). We can
then define the infinitessimal line element,
\[ \begin{align}\begin{aligned} \label{eq:infinitessimalcurve}
\dif{s}^2 = \sum_{i, j} g_{ij} \dif{q_i} \dif{q_j}\\Where :math:`g_{ij}` is the metric for the geometry we are considering.\end{aligned}\end{align} \]
The volume element is then
\[\label{eq:volumecurvi}
\dif{V} = \dif{s}_{1} + \dif{s}_2 + \dif{s}_3 = h_{q_1}h_{q_2}h_{q_3} \dif{q_1} \dif{q_2} \dif{q_3}\]
[Spherical Polar Coordinates] From the relations in equations
([eq:sph1]) to ([eq:sph3]), and considering that
\[\vec{r} = x \vec{e_x} + y \vec{e_y} + z \vec{e_{z}}\]
Then,
\[ \begin{align}\begin{aligned}\begin{split} \begin{aligned}
\frac{\partial \vec r}{\partial r}
&= \frac{\partial x}{\partial r} \vec{e_x} + \frac{\partial y}{\partial r} \vec{e_y} + \frac{\partial z}{\partial r} \vec{e_z} \\
&= \sin \theta \cos \phi \vec{e_{x}} + \sin\theta \sin \phi \vec{e_y} + \cos \theta \vec{e_z} = h_r\vec{e_r} \\
\frac{\partial \vec r}{\partial \theta}
&= \frac{\partial x}{\partial \theta} \vec{e_x} + \frac{\partial y}{\partial \theta} \vec{e_y} + \frac{\partial z}{\partial \theta} \vec{e_z} \\
&= r \cos \theta \cos \phi \vec{e_x} + r \cos \theta \sin \phi \vec{e_y} - r \sin \theta \vec{e_z} = h_{\theta}\vec{e_{\theta}} \\
\frac{\partial \vec r}{\partial \phi}
&= \frac{\partial x}{\partial \phi} \vec{e_x} + \frac{\partial y}{\partial \phi} \vec{e_y} + \frac{\partial z}{\partial \phi} \vec{e_z} \\
&= - \sin \theta \sin \phi \vec{e_{x}} + r \sin\theta \cos \phi \vec{e_y} = h_{\phi}\vec{e_{\phi}} \\
\end{aligned}\end{split}\\Then the scale factors are\end{aligned}\end{align} \]
\[ \begin{align}\begin{aligned}\begin{split} \begin{aligned}
h_r &= \left| \frac{\partial \vec r}{\partial r} \right| = 1\\
h_{\theta} &= \left| \frac{\partial \vec r}{\partial \theta} \right| = r\\
h_{\phi} &= \left| \frac{\partial \vec r}{\partial \phi} \right| = r \sin \theta\\
\end{aligned}\end{split}\\Also, the volume element,\end{aligned}\end{align} \]
\[ \begin{align}\begin{aligned}\dif{V} = r^2 \sin \theta \dif{r} \dif{\theta} \dif{\phi}\\and the square of the infinitessimal line element,\end{aligned}\end{align} \]
\[\dif{s}^2 = \dif{r}^2 + r^2 \dif{\theta}^2 + r^2 \sin^2 \theta
\dif{\phi^2}\]
Curvilinear coordinates
A curvilinear coordinate system is a coordinate system over a space in which the coordinate lines may be curved, and are related to a Cartesian coordinate system by a bijection.
In physics, laws are independent of reference frame and of coordinate system, which allows the use of the most appropriate coordinate system for a specific situation—for example, if a problem has spherical symmetry it is likely to be easiest to solve in spherical polar coordinates.