Blender  V3.3
Namespaces | Functions | Variables
BLI_math_base.hh File Reference
#include <algorithm>
#include <cmath>
#include <type_traits>
#include "BLI_math_base_safe.h"
#include "BLI_utildefines.h"

Go to the source code of this file.

Namespaces

 blender
 
 blender::math
 

Functions

template<typename T >
bool blender::math::is_zero (const T &a)
 
template<typename T >
bool blender::math::is_any_zero (const T &a)
 
template<typename T >
T blender::math::abs (const T &a)
 
template<typename T >
T blender::math::min (const T &a, const T &b)
 
template<typename T >
T blender::math::max (const T &a, const T &b)
 
template<typename T >
void blender::math::max_inplace (T &a, const T &b)
 
template<typename T >
void blender::math::min_inplace (T &a, const T &b)
 
template<typename T >
T blender::math::clamp (const T &a, const T &min, const T &max)
 
template<typename T , BLI_ENABLE_IF((is_math_float_type< T >)) >
T blender::math::mod (const T &a, const T &b)
 
template<typename T , BLI_ENABLE_IF((is_math_float_type< T >)) >
T blender::math::safe_mod (const T &a, const T &b)
 
template<typename T >
void blender::math::min_max (const T &value, T &min, T &max)
 
template<typename T , BLI_ENABLE_IF((is_math_float_type< T >)) >
T blender::math::safe_divide (const T &a, const T &b)
 
template<typename T , BLI_ENABLE_IF((is_math_float_type< T >)) >
T blender::math::floor (const T &a)
 
template<typename T , BLI_ENABLE_IF((is_math_float_type< T >)) >
T blender::math::ceil (const T &a)
 
template<typename T >
T blender::math::distance (const T &a, const T &b)
 
template<typename T , BLI_ENABLE_IF((is_math_float_type< T >)) >
T blender::math::fract (const T &a)
 
template<typename T , typename FactorT , BLI_ENABLE_IF((std::is_arithmetic_v< T >)) , BLI_ENABLE_IF((is_math_float_type< FactorT >)) >
T blender::math::interpolate (const T &a, const T &b, const FactorT &t)
 
template<typename T >
T blender::math::midpoint (const T &a, const T &b)
 

Variables

template<typename T >
constexpr bool blender::math::is_math_float_type = std::is_floating_point_v<T>
 
template<typename T >
constexpr bool blender::math::is_math_integral_type = std::is_integral_v<T>