18#ifndef __FPSDK_COMMON_MATH_HPP__
19#define __FPSDK_COMMON_MATH_HPP__
51constexpr T
Clamp(
const T val,
const T min,
const T max)
53 return std::max(min, std::min(val, max));
67 static_assert(::std::is_floating_point<T>::value,
"Value must be float or double");
68 return degrees * M_PI / 180.0;
81 static_assert(::std::is_floating_point<T>::value,
"Value must be float or double");
82 return radians * 180.0 / M_PI;
double RoundToFracDigits(const double value, const int digits)
Round to desired number of fractional digits (of precision)
constexpr T Clamp(const T val, const T min, const T max)
Clamp value in range.
constexpr T DegToRad(T degrees)
Convert degrees to radians.
constexpr T RadToDeg(T radians)
Convert radians to degrees.