25 #ifndef __I6ENGINE_MATH_I6EMATH_H__
26 #define __I6ENGINE_MATH_I6EMATH_H__
38 const double PI = 4 * std::atan(1);
47 if (std::fabs(direction.
length()) < 1e-15) {
50 Vec3 c = direction * (point - offset);
58 inline uint64_t
binom(uint32_t n, uint32_t k) {
63 for (uint32_t i = 1; i <= k; ++i) {
74 return (rot * pos * rot.
inverse()).toVector();
Class describing a 3d rotation.
#define ISIXE_THROW_API(module, message)
i6eQuaternion inverse() const
return the inverted vector of the quaternion
Implements 3-dimensional vectors.
double disPointLine(const Vec3 &offset, const Vec3 &direction, const Vec3 &point)
returns the distance of a point to a line specified by offset and direction
Vec3 rotateVector(const Vec3 &pos, const Quaternion &rot)
returns the directional vector
double length() const
length of the Vector
uint64_t binom(uint32_t n, uint32_t k)
returns "n over k" keep in mind that this function is likely to overflow with relatively small values...