1 #ifndef IV_MATH_QUATERNION_H 2 #define IV_MATH_QUATERNION_H 21 :
v(x_, y_, z_), w(w_) { }
27 template<
typename OtherT>
29 :
v(other.
x, other.
y, other.
z), w(other.w) { }
32 return Quaternion_(v.
unit() * std::sin(alpha / 2), std::cos(alpha / 2));
39 return std::sqrt(
v.x *
v.x +
v.y *
v.y +
v.z *
v.z + w * w);
84 template<
typename T1,
typename T2>
91 template<
typename T1,
typename T2>
Quaternion_(T x_, T y_, T z_, T w_)
Definition: quaternion.h:20
number_t a12
Definition: matrix.h:36
number_t a13
Definition: matrix.h:37
T len() const
Definition: quaternion.h:38
Quaternion_< float > Quaternionf
Definition: quaternion.h:96
T y
Definition: quaternion.h:13
Vector3_< T > v
Definition: quaternion.h:11
number_t a33
Definition: matrix.h:37
number_t x
Definition: vector.h:110
number_t a21
Definition: matrix.h:35
Quaterniond Quaternion
Definition: quaternion.h:98
T x
Definition: quaternion.h:13
number_t a11
Definition: matrix.h:35
Quaternion_ inversion() const
Definition: quaternion.h:68
Matrix3_< T > matrix() const
Definition: quaternion.h:76
Quaternion_(const Vector3_< T1 > &v_, T w_)
Definition: quaternion.h:24
static Quaternion_ One()
Definition: quaternion.h:36
Quaternion_ unit() const
Definition: quaternion.h:57
Vector3_ unit() const
Definition: vector.h:91
T w
Definition: quaternion.h:16
Quaternion_ operator*(T s) const
Definition: quaternion.h:51
Quaternion_ operator/(T s) const
Definition: quaternion.h:54
number_t a23
Definition: matrix.h:37
static Matrix3_ fromColumns(const vector_t &e1, const vector_t &e2, const vector_t &e3)
Definition: matrix.h:79
number_t y
Definition: vector.h:110
static Quaternion_ Zero()
Definition: quaternion.h:35
Quaternion_< double > Quaterniond
Definition: quaternion.h:97
Definition: quaternion.h:9
Quaternion_ operator-() const
Definition: quaternion.h:48
number_t z
Definition: vector.h:110
T z
Definition: quaternion.h:13
Quaternion_ operator+(const Quaternion_ &q) const
Definition: quaternion.h:42
number_t a22
Definition: matrix.h:36
static Quaternion_ Rotation(const Vector3_< T > &v, double alpha)
Definition: quaternion.h:31
Vector3_< T1 > rotate(const Vector3_< T1 > &v) const
Definition: quaternion.h:72
Quaternion_(const OtherT &other)
Definition: quaternion.h:28
number_t a31
Definition: matrix.h:35
number_t a32
Definition: matrix.h:36