This repository has been archived on 2020-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Indoor/math/Math.h
FrankE f77a28735b added von mises distributionb
quick&dirty: added activity to the grid-walkers
2016-04-21 08:59:05 +02:00

21 lines
375 B
C++

#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