Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/BLI_math_base.hh
| Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | template<typename T, BLI_ENABLE_IF((is_math_float_type<T>))> inline T floor(const T &a) | ||||
| return std::floor(a); | return std::floor(a); | ||||
| } | } | ||||
| template<typename T, BLI_ENABLE_IF((is_math_float_type<T>))> inline T ceil(const T &a) | template<typename T, BLI_ENABLE_IF((is_math_float_type<T>))> inline T ceil(const T &a) | ||||
| { | { | ||||
| return std::ceil(a); | return std::ceil(a); | ||||
| } | } | ||||
| template<typename T> inline T distance(const T &a, const T &b) | |||||
| { | |||||
| return std::abs(a - b); | |||||
| } | |||||
| template<typename T, BLI_ENABLE_IF((is_math_float_type<T>))> inline T fract(const T &a) | template<typename T, BLI_ENABLE_IF((is_math_float_type<T>))> inline T fract(const T &a) | ||||
| { | { | ||||
| return a - std::floor(a); | return a - std::floor(a); | ||||
| } | } | ||||
| template<typename T, BLI_ENABLE_IF((is_math_float_type<T>))> | template<typename T, BLI_ENABLE_IF((is_math_float_type<T>))> | ||||
| inline T interpolate(const T &a, const T &b, const T &t) | inline T interpolate(const T &a, const T &b, const T &t) | ||||
| { | { | ||||
| Show All 10 Lines | |||||