7 #ifndef LIBALMATH_ALMATH_SCENEGRAPH_QIANIM_UTILS_H
8 #define LIBALMATH_ALMATH_SCENEGRAPH_QIANIM_UTILS_H
10 #include <almath/api.h>
12 #include <boost/math/constants/constants.hpp>
20 template <
typename Scalar>
21 typename std::enable_if<std::is_floating_point<Scalar>::value, Scalar>::type
24 return static_cast<Scalar
>(1);
26 return boost::math::constants::pi<Scalar>()/180;
28 return 180/boost::math::constants::pi<Scalar>();
30 throw std::invalid_argument(
"units are not of the same dimension");
36 template <
typename Scalar>
37 typename std::enable_if<std::is_floating_point<Scalar>::value, Scalar>::type
39 return (from ==
Unit::degree) ? boost::math::constants::pi<Scalar>()/180
40 : static_cast<Scalar>(1);
std::enable_if< std::is_floating_point< Scalar >::value, Scalar >::type getUnitConversionFactor(Unit to, Unit from)
std::enable_if< std::is_floating_point< Scalar >::value, Scalar >::type getSIConversionFactor(Unit from)