34 <<
"The radius <" << arg1 <<
"> can not be negative.");
38 <<
"The azimuth angle <" << arg1 <<
"> is not in [0,2Pi).");
42 <<
"The polar angle <" << arg1 <<
"> is not in [0,Pi].");
46 std::array<double, dim>
49 std::array<double, dim> scoord{};
53 if constexpr (dim > 1)
55 scoord[0] = position.
norm();
57 scoord[1] =
std::atan2(position(1), position(0));
64 if constexpr (dim == 3)
68 scoord[2] =
std::acos(position(2) / scoord[0]);
75 template <std::
size_t dim>
90 ccoord[0] = scoord[0] * std::cos(scoord[1]);
91 ccoord[1] = scoord[0] * std::sin(scoord[1]);
99 ccoord[0] = scoord[0] * std::sin(scoord[2]) * std::cos(scoord[1]);
100 ccoord[1] = scoord[0] * std::sin(scoord[2]) * std::sin(scoord[1]);
101 ccoord[2] = scoord[0] * std::cos(scoord[2]);
113 #include "geometric_utilities.inst"
numbers::NumberTraits< Number >::real_type norm() const
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
static ::ExceptionBase & NegativeRadius(double arg1)
static ::ExceptionBase & SphericalAzimuth(double arg1)
static ::ExceptionBase & SphericalPolar(double arg1)
#define Assert(cond, exc)
static ::ExceptionBase & ExcNotImplemented()
#define DeclException1(Exception1, type1, outsequence)
Expression atan2(const Expression &y, const Expression &x)
Expression acos(const Expression &x)
Point< dim > from_spherical(const std::array< double, dim > &scoord)
std::array< double, dim > to_spherical(const Point< dim > &point)
static constexpr double PI