Reference documentation for deal.II version GIT b6bf1e606d 2022-08-11 15:25:02+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Functions
GeometricUtilities::Coordinates Namespace Reference

Functions

template<int dim>
std::array< double, dim > to_spherical (const Point< dim > &point)
 
template<std::size_t dim>
Point< dim > from_spherical (const std::array< double, dim > &scoord)
 
static ::ExceptionBaseNegativeRadius (double arg1)
 
static ::ExceptionBaseSphericalAzimuth (double arg1)
 
static ::ExceptionBaseSphericalPolar (double arg1)
 

Detailed Description

A namespace for coordinate transformations.

Function Documentation

◆ to_spherical()

template<int dim>
std::array< double, dim > GeometricUtilities::Coordinates::to_spherical ( const Point< dim > &  point)

Return spherical coordinates of a Cartesian point point. The returned array is filled with radius, azimuth angle \(\in [0,2 \pi)\) and polar/inclination angle \( \in [0,\pi]\) (omitted in 2D).

In 3D the transformation is given by

\begin{align*} r &= \sqrt{x^2+y^2+z^2} \\ \theta &= {\rm atan}(y/x) \\ \phi &= {\rm acos} (z/r) \end{align*}

The use of this function is demonstrated in step-75.

Definition at line 47 of file geometric_utilities.cc.

◆ from_spherical()

template<std::size_t dim>
Point< dim > GeometricUtilities::Coordinates::from_spherical ( const std::array< double, dim > &  scoord)

Return the Cartesian coordinates of a spherical point defined by scoord which is filled with radius \(r \in [0,\infty)\), azimuth angle \(\theta \in [0,2 \pi)\) and polar/inclination angle \(\phi \in [0,\pi]\) (omitted in 2D).

In 3D the transformation is given by

\begin{align*} x &= r\, \cos(\theta) \, \sin(\phi) \\ y &= r\, \sin(\theta) \, \sin(\phi) \\ z &= r\, \cos(\phi) \end{align*}

Definition at line 73 of file geometric_utilities.cc.