15 "length of vector less than 1e-12");
36 const double tol = 1
e-12;
58 axis = normalize(axis);
65 double cosAngle =
sqrt(0.5 * (1 +
dot(u,
ref)));
66 double sinAngle =
sqrt(1 - cosAngle * cosAngle);
81 return result *= other;
89 *
this =
Quaternion((*
this)(0) * other(0) -
dot(imagThis, imagOther),
90 (*
this)(0) * imagOther + other(0) * imagThis +
cross(imagThis, imagOther));
105 if (this->
Norm() < 1
e-12)
107 "length of quaternion less than 1e-12");
110 (*this) /= this->
length();
127 "quaternion isn't unit quaternion. Norm: " + std::to_string(this->
Norm()));
132 return ((*
this) * (quat * (*this).
conjugate())).imag();
140 2 * (-rot(0) * rot(3) + rot(1) * rot(2)),
141 2 * (rot(0) * rot(2) + rot(1) * rot(3)),
142 2 * (rot(0) * rot(3) + rot(1) * rot(2)),
143 1 - 2 * (rot(1) * rot(1) + rot(3) * rot(3)),
144 2 * (-rot(0) * rot(1) + rot(2) * rot(3)),
145 2 * (-rot(0) * rot(2) + rot(1) * rot(3)),
146 2 * (rot(0) * rot(1) + rot(2) * rot(3)),
147 1 - 2 * (rot(1) * rot(1) + rot(2) * rot(2)));
Tps< T > cos(const Tps< T > &x)
Cosine.
Tps< T > sin(const Tps< T > &x)
Sine.
Tps< T > sqrt(const Tps< T > &x)
Square root.
Quaternion getQuaternion(Vector_t u, Vector_t ref)
Vector3D cross(const Vector3D &lhs, const Vector3D &rhs)
Vector cross product.
double dot(const Vector3D &lhs, const Vector3D &rhs)
Vector dot product.
T::PETE_Expr_t::PETE_Return_t max(const PETE_Expr< T > &expr, NDIndex< D > &loc)
PETE_TUTree< FnAbs, typename T::PETE_Expr_t > abs(const PETE_Expr< T > &l)
PETE_TBTree< FnCopysign, PETE_Scalar< Vektor< T1, Dim > >, typename T2::PETE_Expr_t > copysign(const Vektor< T1, Dim > &l, const PETE_Expr< T2 > &r)
RandomNumberGen IpplRandom
constexpr double e
The value of.
constexpr double pi
The value of.
Vector_t rotate(const Vector_t &) const
Quaternion conjugate() const
Quaternion inverse() const
Tenzor< double, 3 > getRotationMatrix() const
Quaternion & operator*=(const Quaternion &)
Quaternion operator/(const double &) const
Quaternion operator*(const double &) const
Vektor< double, 3 > Vector_t