39 #include <SPL/config.hpp> 43 #if !defined(SPL_HAVE_STD_BESSEL) 44 # if defined(SPL_HAVE_TR1_BESSEL) 47 # include <boost/tr1/cmath.hpp> 76 return (x >= 0) ? x : (-x);
92 }
else if (x < T(0)) {
117 inline T
clip(T x, T min, T max)
127 assert(result >= min && result <= max);
176 result = x / y + ((x % y) ? (-1) : 0);
189 x += (((-x) / y) + 1) * y;
191 assert(x >= 0 && y > 0);
195 inline long mod(
long x,
long y)
199 x += (((-x) / y) + 1) * y;
201 assert(x >= 0 && y > 0);
227 return x * 180.0 / M_PI;
239 return x * M_PI / 180.0;
245 #if defined(SPL_HAVE_STD_BESSEL) 246 using std::cyl_bessel_i;
248 # if defined(SPL_HAVE_TR1_BESSEL) 250 using std::tr1::cyl_bessel_i;
253 using std::tr1::cyl_bessel_i;
long roundTowardZeroDiv(long x, long y)
Compute a quotient with the result rounded towards zero.
Definition: math.hpp:153
Definition: Arcball.hpp:48
T mod(T x, T y)
Compute the remainder after division.
Definition: math.hpp:185
T absVal(T x)
The absolute value function.
Definition: math.hpp:74
T clip(T x, T min, T max)
The clip function.
Definition: math.hpp:117
double radToDeg(double x)
Convert from radians to degrees.
Definition: math.hpp:225
double degToRad(double x)
Convert from degrees to radians.
Definition: math.hpp:237
long ceilDiv(long x, long y)
Compute the ceiling of a quotient.
Definition: math.hpp:213
long floorDiv(long x, long y)
Compute the floor of a quotient.
Definition: math.hpp:165
T signum(T x)
The signum function.
Definition: math.hpp:87
double sinc(double x)
The cardinal sine function.
Definition: math.hpp:138
T sqr(const T &x)
The square function.
Definition: math.hpp:108