27#ifndef EASY3D_CORE_CONSTANT_H
28#define EASY3D_CORE_CONSTANT_H
38#define M_PI 3.14159265358979323846264338327950288
43 template <
typename FT>
inline FT
min();
45 template <
typename FT>
inline FT
max();
50 template <>
inline int min<int>() {
return INT_MIN; }
52 template <>
inline int max<int>() {
return INT_MAX; }
54 template <>
inline float min<float>() {
return FLT_MIN; }
56 template <>
inline float max<float>() {
return FLT_MAX; }
63 template <
typename FT>
inline FT
epsilon();
80 bool epsilon_equal(FT
const& x, FT
const& y, FT
const& eps) {
return std::abs(x - y) < eps; }
84 bool epsilon_not_equal(FT
const& x, FT
const& y, FT
const& eps) {
return std::abs(x - y) >= eps; }
Definition: collider.cpp:182
int max< int >()
Function returning max for int type numbers.
Definition: constant.h:52
bool epsilon_equal(FT const &x, FT const &y, FT const &eps)
Tests if two values are Epsilon equal.
Definition: constant.h:80
double min< double >()
Function returning min for double type numbers.
Definition: constant.h:58
float epsilon_sqr< float >()
Function returning squared epsilon for float type numbers.
Definition: constant.h:71
double epsilon< double >()
Function returning epsilon for double type numbers.
Definition: constant.h:73
double epsilon_sqr< double >()
Function returning squared epsilon for double type numbers.
Definition: constant.h:75
FT max()
Function returning maximum representable value for a given type.
float min< float >()
Function returning min for float type numbers.
Definition: constant.h:54
int min< int >()
Function returning min for int type numbers.
Definition: constant.h:50
FT epsilon()
Function returning the epsilon value for a given type.
bool epsilon_not_equal(FT const &x, FT const &y, FT const &eps)
Tests if two values are not Epsilon equal.
Definition: constant.h:84
float max< float >()
Function returning max for float type numbers.
Definition: constant.h:56
double max< double >()
Function returning max for double type numbers.
Definition: constant.h:60
FT epsilon_sqr()
Function returning the squared epsilon value for a given type.
FT min()
Function returning minimum representable value for a given type.
float epsilon< float >()
Function returning epsilon for float type numbers.
Definition: constant.h:69