57 #define M_PI 3.14159265359
65template <
class T,
typename Real>
66inline bool is_zero(
const T& _a, Real _eps)
67{
return fabs(_a) < _eps; }
69template <
class T1,
class T2,
typename Real>
70inline bool is_eq(
const T1& a,
const T2& b, Real _eps)
73template <
class T1,
class T2,
typename Real>
74inline bool is_gt(
const T1& a,
const T2& b, Real _eps)
75{
return (a > b) && !is_eq(a,b,_eps); }
77template <
class T1,
class T2,
typename Real>
78inline bool is_ge(
const T1& a,
const T2& b, Real _eps)
79{
return (a > b) || is_eq(a,b,_eps); }
81template <
class T1,
class T2,
typename Real>
82inline bool is_lt(
const T1& a,
const T2& b, Real _eps)
83{
return (a < b) && !is_eq(a,b,_eps); }
85template <
class T1,
class T2,
typename Real>
86inline bool is_le(
const T1& a,
const T2& b, Real _eps)
87{
return (a < b) || is_eq(a,b,_eps); }
91const float flt_eps__ = (float)1e-05;
92const double dbl_eps__ = 1e-09;
94inline float eps__(
float)
97inline double eps__(
double)
102{
return is_zero(a, eps__(a)); }
104template <
class T1,
class T2>
105inline bool is_eq(
const T1& a,
const T2& b)
108template <
class T1,
class T2>
109inline bool is_gt(
const T1& a,
const T2& b)
110{
return (a > b) && !is_eq(a,b); }
112template <
class T1,
class T2>
113inline bool is_ge(
const T1& a,
const T2& b)
114{
return (a > b) || is_eq(a,b); }
116template <
class T1,
class T2>
117inline bool is_lt(
const T1& a,
const T2& b)
118{
return (a < b) && !is_eq(a,b); }
120template <
class T1,
class T2>
121inline bool is_le(
const T1& a,
const T2& b)
122{
return (a < b) || is_eq(a,b); }
148 return (T) _sin_angle >= 0 ? acos(_cos_angle) : -acos(_cos_angle);
152inline T positive_angle(T _angle)
153{
return _angle < 0 ? (2*M_PI + _angle) : _angle; }
156inline T positive_angle(T _cos_angle, T _sin_angle)
157{
return positive_angle(
angle(_cos_angle, _sin_angle)); }
160inline T deg_to_rad(
const T& _angle)
161{
return M_PI*(_angle/180); }
164inline T rad_to_deg(
const T& _angle)
165{
return 180*(_angle/M_PI); }
167inline double log_(
double _value)
168{
return log(_value); }
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:64
T angle(T _cos_angle, T _sin_angle)
returns the angle determined by its cos and the sign of its sin result is positive if the angle is in...
Definition: MathDefs.hh:145
bool is_zero(const T &_a, Real _eps)
comparison operators with user-selected precision control
Definition: MathDefs.hh:66
T sane_aarg(T _aarg)
Trigonometry/angles - related.
Definition: MathDefs.hh:127