48 #include <visp3/core/vpThetaUVector.h> 50 const double vpThetaUVector::minimum = 0.0001;
63 for (
unsigned int i = 0; i < 3; i++)
127 for (
unsigned int i = 0; i < 3; i++)
140 s = (R[1][0] - R[0][1]) * (R[1][0] - R[0][1]) + (R[2][0] - R[0][2]) * (R[2][0] - R[0][2]) +
141 (R[2][1] - R[1][2]) * (R[2][1] - R[1][2]);
143 c = (R[0][0] + R[1][1] + R[2][2] - 1.0) / 2.0;
147 if ((1 + c) > minimum)
151 data[0] = (R[2][1] - R[1][2]) / (2 * sinc);
152 data[1] = (R[0][2] - R[2][0]) / (2 * sinc);
153 data[2] = (R[1][0] - R[0][1]) / (2 * sinc);
156 if ((R[0][0] - c) < std::numeric_limits<double>::epsilon())
159 data[0] = theta * (sqrt((R[0][0] - c) / (1 - c)));
160 if ((R[2][1] - R[1][2]) < 0)
163 if ((R[1][1] - c) < std::numeric_limits<double>::epsilon())
166 data[1] = theta * (sqrt((R[1][1] - c) / (1 - c)));
168 if ((R[0][2] - R[2][0]) < 0)
171 if ((R[2][2] - c) < std::numeric_limits<double>::epsilon())
174 data[2] = theta * (sqrt((R[2][2] - c) / (1 - c)));
176 if ((R[1][0] - R[0][1]) < 0)
251 for (
unsigned int i = 0; i <
dsize; i++)
282 if (tu.
size() != 3) {
286 for (
unsigned int i = 0; i < 3; i++)
326 if (std::fabs(theta) <= std::numeric_limits<double>::epsilon()) {
330 for (
unsigned int i = 0; i < 3; i++)
331 u[i] =
data[i] / theta;
387 if (std::fabs(theta) <= std::numeric_limits<double>::epsilon()) {
391 for (
unsigned int i = 0; i < 3; i++)
392 u[i] =
data[i] / theta;
vpThetaUVector & operator=(const vpColVector &tu)
Implementation of a generic rotation vector.
Implementation of an homogeneous matrix and operations on such kind of matrices.
void extract(double &theta, vpColVector &u) const
error that can be emited by ViSP classes.
double * data
Address of the first element of the data array.
unsigned int size() const
Return the number of elements of the 2D array.
Implementation of a rotation vector as Euler angle minimal representation.
void extract(vpRotationMatrix &R) const
vpThetaUVector buildFrom(const vpHomogeneousMatrix &M)
static double sinc(double x)
Implementation of a rotation matrix and operations on such kind of matrices.
Implementation of a rotation vector as quaternion angle minimal representation.
Implementation of column vector and the associated operations.
Implementation of a pose vector and operations on poses.
Implementation of a rotation vector as Euler angle minimal representation.
unsigned int dsize
Current array size (rowNum * colNum)
Implementation of a rotation vector as Euler angle minimal representation.
Implementation of a rotation vector as axis-angle minimal representation.
void resize(const unsigned int i, const bool flagNullify=true)