aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/math/math.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-10-19 08:36:44 +0800
committerchai <chaifix@163.com>2018-10-19 08:36:44 +0800
commit7d5f055547e70fa93ee9ac944e62f8d657b9dc55 (patch)
tree081782a1541854db4b8eb69c4b43081f52711286 /src/libjin/math/math.h
parent02dd1f38008594048f0e28bad01e7c6d18844198 (diff)
*修改文件名
Diffstat (limited to 'src/libjin/math/math.h')
-rw-r--r--src/libjin/math/math.h77
1 files changed, 0 insertions, 77 deletions
diff --git a/src/libjin/math/math.h b/src/libjin/math/math.h
deleted file mode 100644
index c1b5084..0000000
--- a/src/libjin/math/math.h
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef __LIBJIN_UTILS_MATH_H
-#define __LIBJIN_UTILS_MATH_H
-
-#include "constant.h"
-#include "matrix.h"
-#include "quad.h"
-
-namespace jin
-{
- namespace math
- {
-
- #ifdef min
- # undef min
- #endif // min
- #ifdef max
- # undef max
- #endif // max
-
- template<typename T>
- inline T min(T a, T b)
- {
- return a < b ? a : b;
- }
-
- template<typename T>
- inline T max(T a, T b)
- {
- return a > b ? a : b;
- }
-
- template<typename T>
- inline T clamp(T a, T mi, T ma)
- {
- return min<T>(max<T>(a, mi), ma);
- }
-
- template<typename T>
- inline bool within(T a, T mi, T ma)
- {
- return a >= mi && a <= ma;
- }
-
- template<typename T>
- inline bool without(T a, T mi, T ma)
- {
- return a < mi || a > ma;
- }
-
- template<typename T>
- inline T abs(T a)
- {
- return a > 0 ? a : -a;
- }
-
- template<typename T>
- inline T lowerBound(T a, T lower)
- {
- return a < lower ? lower : a;
- }
-
- template<typename T>
- inline T upperBound(T a, T upper)
- {
- return a > upper ? upper : a;
- }
-
- template<typename T>
- inline T lerp(T a, T b, float t)
- {
- return a + t * (b - a);
- }
-
- } // namespace math
-} // namespace jin
-
-#endif \ No newline at end of file