17 #include <deal.II/base/geometric_utilities.h> 18 #include <deal.II/base/exceptions.h> 21 DEAL_II_NAMESPACE_OPEN
31 <<
"The radius <" << arg1 <<
"> can not be negative.");
35 <<
"The azimuth angle <" << arg1 <<
"> is not in [0,2Pi).");
39 <<
"The polar angle <" << arg1 <<
"> is not in [0,Pi].");
43 std_cxx11::array<double,dim>
46 std_cxx11::array<double,dim> scoord;
49 scoord[0] = position.
norm();
51 scoord[1] = std::atan2(position(1),position(0));
60 if (scoord[0] > std::numeric_limits<double>::min())
61 scoord[2] = std::acos(position(2)/scoord[0]);
68 template <std::
size_t dim>
84 ccoord[0] = scoord[0] * std::cos(scoord[1]);
85 ccoord[1] = scoord[0] * std::sin(scoord[1]);
93 ccoord[0] = scoord[0] * std::sin(scoord[2]) * std::cos(scoord[1]);
94 ccoord[1] = scoord[0] * std::sin(scoord[2]) * std::sin(scoord[1]);
95 ccoord[2] = scoord[0] * std::cos(scoord[2]);
107 template Point<2> from_spherical<2>(
const std_cxx11::array<double,2> &);
108 template Point<3> from_spherical<3>(
const std_cxx11::array<double,3> &);
109 template std_cxx11::array<double,2> to_spherical<2>(
const Point<2> &);
110 template std_cxx11::array<double,3> to_spherical<3>(
const Point<3> &);
115 DEAL_II_NAMESPACE_CLOSE
Point< dim > from_spherical(const std_cxx11::array< double, dim > &scoord)
numbers::NumberTraits< Number >::real_type norm() const
std_cxx11::array< double, dim > to_spherical(const Point< dim > &point)
static ::ExceptionBase & SphericalPolar(double arg1)
#define DeclException1(Exception1, type1, outsequence)
#define Assert(cond, exc)
static ::ExceptionBase & SphericalAzimuth(double arg1)
static ::ExceptionBase & NegativeRadius(double arg1)
static ::ExceptionBase & ExcNotImplemented()