1 #ifndef __JMATHTOOLKIT__
2 #define __JMATHTOOLKIT__
27 namespace JPP {
using namespace JMATH; }
40 inline long long int factorial(
const long long int n)
60 inline long long int factorial(
const long long int n,
const long long int m)
62 if (n < 0 || m < 0 || n < m) {
82 template<
class JFirst_t,
class JSecond_t>
84 const JSecond_t& second)
86 return first.getDistanceSquared(second);
97 template<
class JFirst_t,
class JSecond_t>
99 const JSecond_t& second)
101 return first.getDistance(second);
112 template<
class JFirst_t,
class JSecond_t>
113 inline double getDot(
const JFirst_t& first,
114 const JSecond_t& second)
116 return first.getDot(second);
127 template<
class JFirst_t,
class JSecond_t>
129 const JSecond_t& second)
131 const double dot =
getDot(first,second);
135 else if (dot <= -1.0)
138 return acos(dot) * 180.0 / acos(-1.0);
149 template<
class JFirst_t,
class JSecond_t>
151 const JSecond_t& second)
153 return first.getPerpDot(second);
171 return T(first).interpolate(second, alpha);
double getAngle(const JFirst_t &first, const JSecond_t &second)
Get space angle between objects.
double getDot(const JNeutrinoDirection &first, const JNeutrinoDirection &second)
Dot product.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
double getDistanceSquared(const JFirst_t &first, const JSecond_t &second)
Get square of distance between objects.
T interpolate(const T &first, const T &second, const double alpha)
Interpolation between objects.
double getPerpDot(const JFirst_t &first, const JSecond_t &second)
Get perpendicular dot product of objects.
long long int factorial(const long long int n)
Determine factorial.
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
Exception for accessing a value in a collection that is outside of its range.