35 <<
"The radius <" << arg1 <<
"> can not be negative.");
39 <<
"The azimuth angle <" << arg1 <<
"> is not in [0,2Pi).");
43 <<
"The polar angle <" << arg1 <<
"> is not in [0,Pi].");
47 std::array<double, dim>
50 std::array<double, dim> scoord{};
54 if constexpr (dim > 1)
56 scoord[0] = position.
norm();
58 scoord[1] = std::atan2(position[1], position[0]);
65 if constexpr (dim == 3)
68 if (scoord[0] > std::numeric_limits<double>::min())
69 scoord[2] =
std::acos(position[2] / scoord[0]);
76 template <std::
size_t dim>
91 ccoord[0] = scoord[0] *
std::cos(scoord[1]);
92 ccoord[1] = scoord[0] *
std::sin(scoord[1]);
102 ccoord[2] = scoord[0] *
std::cos(scoord[2]);
114#include "base/geometric_utilities.inst"
numbers::NumberTraits< Number >::real_type norm() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_NOT_IMPLEMENTED()
static ::ExceptionBase & SphericalAzimuth(double arg1)
static ::ExceptionBase & NegativeRadius(double arg1)
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
static ::ExceptionBase & SphericalPolar(double arg1)
#define DeclException1(Exception1, type1, outsequence)
Point< dim > from_spherical(const std::array< double, dim > &scoord)
std::array< double, dim > to_spherical(const Point< dim > &point)
::VectorizedArray< Number, width > cos(const ::VectorizedArray< Number, width > &)
::VectorizedArray< Number, width > sin(const ::VectorizedArray< Number, width > &)
inline ::VectorizedArray< Number, width > acos(const ::VectorizedArray< Number, width > &x)