Template Function cif::spherical

Function Documentation

template<typename T>
inline quaternion_type<T> cif::spherical(T const &rho, T const &theta, T const &phi1, T const &phi2)

This code is similar to the code in boost so I copy the documentation as well:

spherical is a simple transposition of polar, it takes as inputs a (positive) magnitude and a point on the hypersphere, given by three angles. The first of these, theta has a natural range of -pi to +pi, and the other two have natural ranges of -pi/2 to +pi/2 (as is the case with the usual spherical coordinates in R3). Due to the many symmetries and periodicities, nothing untoward happens if the magnitude is negative or the angles are outside their natural ranges. The expected degeneracies (a magnitude of zero ignores the angles settings…) do happen however.