added von mises distributionb
quick&dirty: added activity to the grid-walkers
This commit is contained in:
20
math/Math.h
Normal file
20
math/Math.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef K_MATH_MATH_H
|
||||
#define K_MATH_MATH_H
|
||||
|
||||
#include "../Defines.h"
|
||||
|
||||
class Math {
|
||||
|
||||
public:
|
||||
|
||||
/** ensure val stays within [min:max] */
|
||||
template <typename Scalar> static inline Scalar clamp(const Scalar min, const Scalar max, const Scalar val) {
|
||||
if (unlikely(val < min)) {return min;}
|
||||
if (unlikely(val > max)) {return max;}
|
||||
return val;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // K_MATH_MATH_H
|
||||
Reference in New Issue
Block a user