52 #define M_PI 3.14159265359
60template <
class T,
typename Real>
61inline bool is_zero(
const T& _a, Real _eps)
62{
return fabs(_a) < _eps; }
64template <
class T1,
class T2,
typename Real>
65inline bool is_eq(
const T1& a,
const T2& b, Real _eps)
68template <
class T1,
class T2,
typename Real>
69inline bool is_gt(
const T1& a,
const T2& b, Real _eps)
70{
return (a > b) && !is_eq(a,b,_eps); }
72template <
class T1,
class T2,
typename Real>
73inline bool is_ge(
const T1& a,
const T2& b, Real _eps)
74{
return (a > b) || is_eq(a,b,_eps); }
76template <
class T1,
class T2,
typename Real>
77inline bool is_lt(
const T1& a,
const T2& b, Real _eps)
78{
return (a < b) && !is_eq(a,b,_eps); }
80template <
class T1,
class T2,
typename Real>
81inline bool is_le(
const T1& a,
const T2& b, Real _eps)
82{
return (a < b) || is_eq(a,b,_eps); }
86const float flt_eps__ = (float)1e-05;
87const double dbl_eps__ = 1e-09;
89inline float eps__(
float)
92inline double eps__(
double)
99template <
class T1,
class T2>
100inline bool is_eq(
const T1& a,
const T2& b)
103template <
class T1,
class T2>
104inline bool is_gt(
const T1& a,
const T2& b)
105{
return (a > b) && !is_eq(a,b); }
107template <
class T1,
class T2>
108inline bool is_ge(
const T1& a,
const T2& b)
109{
return (a > b) || is_eq(a,b); }
111template <
class T1,
class T2>
112inline bool is_lt(
const T1& a,
const T2& b)
113{
return (a < b) && !is_eq(a,b); }
115template <
class T1,
class T2>
116inline bool is_le(
const T1& a,
const T2& b)
117{
return (a < b) || is_eq(a,b); }
143 return (T) _sin_angle >= 0 ? acos(_cos_angle) : -acos(_cos_angle);
147inline T positive_angle(T _angle)
148{
return _angle < 0 ? (2*M_PI + _angle) : _angle; }
151inline T positive_angle(T _cos_angle, T _sin_angle)
152{
return positive_angle(
angle(_cos_angle, _sin_angle)); }
155inline T deg_to_rad(
const T& _angle)
156{
return M_PI*(_angle/180); }
159inline T rad_to_deg(
const T& _angle)
160{
return 180*(_angle/M_PI); }
162inline double log_(
double _value)
163{
return log(_value); }
Contains all the mesh ingredients like the polygonal mesh, the triangle mesh, different mesh kernels ...
Definition: MeshItems.hh:59
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:140
bool is_zero(const T &_a, Real _eps)
comparison operators with user-selected precision control
Definition: MathDefs.hh:61
T sane_aarg(T _aarg)
Trigonometry/angles - related.
Definition: MathDefs.hh:122