* Return spherical coordinates of a Cartesian point @p point.
* The returned array is filled with radius, azimuth angle $\in [0,2 \pi)$
* and polar/inclination angle $ \in [0,\pi]$ (ommited in 2D).
+ *
+ * In 3D the transformation is given by
+ * @f{align*}
+ * r &= \sqrt{x^2+y^2+z^2} \\
+ * \theta &= {\rm atan}(y/x) \\
+ * \phi &= {\rm acos} (z/r)
+ * @f}
*/
template <int dim>
std_cxx11::array<double,dim>
/**
* Return the Cartesian coordinates of a spherical point defined by @p scoord
- * which is filled with radius $\in [0,\infty)$, azimuth angle
- * $\in [0,2 \pi)$ and polar/inclination angle $\in [0,\pi]$
+ * which is filled with radius $r \in [0,\infty)$, azimuth angle
+ * $\theta \in [0,2 \pi)$ and polar/inclination angle $\phi \in [0,\pi]$
* (ommited in 2D).
+ *
+ * In 3D the transformation is given by
+ * @f{align*}
+ * x &= r\, \cos(\theta) \, \sin(\phi) \\
+ * y &= r\, \sin(\theta) \, \sin(\phi) \\
+ * z &= r\, \cos(\phi)
+ * @f}
*/
template <std::size_t dim>
Point<dim>
// radius
scoord[0] = position.norm();
- // azimuth angle
+ // azimuth angle \theta:
scoord[1] = std::atan2(position(1),position(0));
// correct to [0,2*pi)
if (scoord[1] < 0.0)
scoord[1] += 2.0*numbers::PI;
- // polar angle
+ // polar angle \phi:
if (dim==3)
{
// acos returns the angle in the range [0,\pi]