Go to the documentation of this file.
31 #ifndef DUAL_QUATERNION_HPP
32 #define DUAL_QUATERNION_HPP
41 template<
typename T>
inline int sign(T v)
43 return (v < 0) ? -1 : 1;
50 M(i, j + 1) = -w * q.
i;
51 M(i, j + 2) = -w * q.
j;
52 M(i, j + 3) = -w * q.
k;
53 M(i + 1, j) = w * q.
i;
54 M(i + 1, j + 1) = w * q.
w;
55 M(i + 1, j + 2) = -w * q.
k;
56 M(i + 1, j + 3) = w * q.
j;
57 M(i + 2, j) = w * q.
j;
58 M(i + 2, j + 1) = w * q.
k;
59 M(i + 2, j + 2) = w * q.
w;
60 M(i + 2, j + 3) = -w * q.
i;
61 M(i + 3, j) = w * q.
k;
62 M(i + 3, j + 1) = -w * q.
j;
63 M(i + 3, j + 2) = w * q.
i;
64 M(i + 3, j + 3) = w * q.
w;
136 const double h0 = std::acos(
R.
w);
147 const double ish0 = 1.0 /
norm(
R);
150 const double he = -
tR_2.
w * ish0;
172 const double h0 = 2.0 *
norm(
R);
184 const double sh0 = sin(h0), ch0 = cos(h0);
193 Rp *= he * ch0 * 2.0 / h0;
209 result.
R = a.
R * b.
R;
238 M(i, j + 4) = M(i, j + 5) = M(i, j + 6) = M(i, j + 7) = 0;
239 M(i + 1, j + 4) = M(i + 1, j + 5) = M(i + 1, j + 6) = M(i + 1, j + 7) = 0;
240 M(i + 2, j + 4) = M(i + 2, j + 5) = M(i + 2, j + 6) = M(i + 2, j + 7) = 0;
241 M(i + 3, j + 4) = M(i + 3, j + 5) = M(i + 3, j + 6) = M(i + 3, j + 7) = 0;
258 return out <<
"( " << dq.
R.
w <<
", " << dq.
R.
i <<
", " << dq.
R.
j <<
", " << dq.
R.
k <<
", "
dual_quaternion exp(dual_quaternion a)
void set_quaternion_matrix(matrix< double > &M, const quaternion< double > &q, int i=0, int j=0, double w=1.0)
void normalize(quaternion< T > &q)
double dot(const dual_quaternion &a, const dual_quaternion &b)
static dual_quaternion rigid_transformation(const quaternion< double > &r, const point3d &t)
dual_quaternion(double v=1.0)
T dot(const quaternion< T > &a, const quaternion< T > &b)
dual_quaternion operator*(const dual_quaternion &a, const dual_quaternion &b)
std::ostream & operator<<(std::ostream &out, const dual_quaternion &dq)
point3d get_translation()
dual_quaternion & normalize()
dual_quaternion operator~(const dual_quaternion &a)
dual_quaternion & operator*=(double a)
quaternion< double > tR_2
void set_dual_quaternion_matrix(matrix< double > &M, const dual_quaternion &dq, int i=0, int j=0, double w=1.0)
static dual_quaternion convert(const double *p)
dual_quaternion log(dual_quaternion a)
T norm(const quaternion< T > &a)
dual_quaternion operator!(const dual_quaternion &a)
void to_vector(T *p) const
dual_quaternion & operator+=(const dual_quaternion &a)
static constexpr double dq_epsilon
void to_vector(double *p)
trac_ik_lib
Author(s): Patrick Beeson, Barrett Ames
autogenerated on Thu May 22 2025 02:28:51