39 #include <SPL/config.hpp>
43 #if defined(SPL_HAVE_TR1_BESSEL)
47 #include <boost/tr1/cmath.hpp>
75 return (x >= 0) ? x : (-x);
91 }
else if (x < T(0)) {
116 inline T
clip(T x, T min, T max)
126 assert(result >= min && result <= max);
175 result = x / y + ((x % y) ? (-1) : 0);
188 x += (((-x) / y) + 1) * y;
190 assert(x >= 0 && y > 0);
194 inline long mod(
long x,
long y)
198 x += (((-x) / y) + 1) * y;
200 assert(x >= 0 && y > 0);
226 return x * 180.0 / M_PI;
238 return x * M_PI / 180.0;
244 #if defined(SPL_HAVE_TR1_BESSEL)
246 using std::tr1::cyl_bessel_i;
249 using std::tr1::cyl_bessel_i;
long roundTowardZeroDiv(long x, long y)
Compute a quotient with the result rounded towards zero.
Definition: math.hpp:152
Definition: Arcball.hpp:48
T mod(T x, T y)
Compute the remainder after division.
Definition: math.hpp:184
T absVal(T x)
The absolute value function.
Definition: math.hpp:73
T clip(T x, T min, T max)
The clip function.
Definition: math.hpp:116
double radToDeg(double x)
Convert from radians to degrees.
Definition: math.hpp:224
double degToRad(double x)
Convert from degrees to radians.
Definition: math.hpp:236
long ceilDiv(long x, long y)
Compute the ceiling of a quotient.
Definition: math.hpp:212
long floorDiv(long x, long y)
Compute the floor of a quotient.
Definition: math.hpp:164
T signum(T x)
The signum function.
Definition: math.hpp:86
double sinc(double x)
The cardinal sine function.
Definition: math.hpp:137
T sqr(const T &x)
The square function.
Definition: math.hpp:107