25 double d0 = rotmat(0, 0),
d1 = rotmat(1, 1), d2 = rotmat(2, 2);
28 double rr = 1.0 + d0 +
d1 + d2;
30 double &_x = vector(1);
31 double &_y = vector(2);
32 double &_z = vector(3);
33 double &_r = vector(0);
36 double s = 0.5 / sqrt(rr);
37 _x = (rotmat(2, 1) - rotmat(1, 2)) * s;
38 _y = (rotmat(0, 2) - rotmat(2, 0)) * s;
39 _z = (rotmat(1, 0) - rotmat(0, 1)) * s;
44 if ((d0 >
d1) && (d0 > d2)) {
45 double s = 0.5 / sqrt(1 + d0 -
d1 - d2);
47 _y = (rotmat(0, 1) + rotmat(1, 0)) * s;
48 _z = (rotmat(0, 2) + rotmat(2, 0)) * s;
49 _r = (rotmat(1, 2) + rotmat(2, 1)) * s;
51 double s = 0.5 / sqrt(1 + d0 -
d1 - d2);
52 _x = (rotmat(0, 1) + rotmat(1, 0)) * s;
54 _z = (rotmat(1, 2) + rotmat(2, 1)) * s;
55 _r = (rotmat(0, 2) + rotmat(2, 0)) * s;
57 double s = 0.5 / sqrt(1 + d0 -
d1 - d2);
58 _x = (rotmat(0, 2) + rotmat(2, 0)) * s;
59 _y = (rotmat(1, 2) + rotmat(2, 1)) * s;
61 _r = (rotmat(0, 1) + rotmat(1, 0)) * s;
72 double theta = sqrt(ut(0) * ut(0) + ut(1) * ut(1) + ut(2) * ut(2));
73 double si = sin(theta);
74 double co = cos(theta);
75 vector(0) = ut(0) / si;
76 vector(1) = ut(1) / si;
77 vector(2) = ut(2) / si;
89 const double &_x = vector(1);
90 const double &_y = vector(2);
91 const double &_z = vector(3);
92 const double &_r = vector(0);
99 rotmat(0, 0) = r2 + x2 - y2 - z2;
100 rotmat(1, 1) = r2 - x2 + y2 - z2;
101 rotmat(2, 2) = r2 - x2 - y2 + z2;
110 rotmat(0, 1) = 2 * (xy - rz);
111 rotmat(0, 2) = 2 * (zx + ry);
112 rotmat(1, 0) = 2 * (xy + rz);
113 rotmat(1, 2) = 2 * (yz - rx);
114 rotmat(2, 0) = 2 * (zx - ry);
115 rotmat(2, 1) = 2 * (yz + rx);
122 res.vector(0) = vector(0);
123 res.vector(1) = -vector(1);
124 res.vector(2) = -vector(2);
125 res.vector(3) = -vector(3);
131 double &a1 = vector(0);
132 double &b1 = vector(1);
133 double &c1 = vector(2);
134 double &
d1 = vector(3);
136 double &a2 =
q2.vector(0);
137 double &b2 =
q2.vector(1);
138 double &
c2 =
q2.vector(2);
139 double &d2 =
q2.vector(3);
141 res.vector(0) = a1 * a2 - b1 * b2 - c1 * c2 - d1 * d2;
142 res.vector(1) = a1 * b2 + b1 * a2 + c1 * d2 - d1 * c2;
143 res.vector(2) = a1 * c2 + c1 * a2 + d1 * b2 - b1 * d2;
144 res.vector(3) = a1 * d2 + d1 * a2 + b1 * c2 - c1 * b2;
Eigen::Quaternion< double > SOT_CORE_EXPORT VectorQuaternion
Eigen::Matrix< double, 3, 3 > MatrixRotation
#define sotDEBUGOUT(level)
#define sotDEBUGIN(level)
Eigen::Vector3d SOT_CORE_EXPORT VectorRotation
Eigen::AngleAxis< double > VectorUTheta
static const double ANGLE_MINIMUM
static const double COSC_MINIMUM
static const double SINC_MINIMUM