48 #include <visp3/core/vpThetaUVector.h> 50 const double vpThetaUVector::minimum = 0.0001;
138 for (
unsigned int i = 0; i < 3; i++)
151 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]) +
152 (R[2][1] - R[1][2]) * (R[2][1] - R[1][2]);
154 c = (R[0][0] + R[1][1] + R[2][2] - 1.0) / 2.0;
158 if ((1 + c) > minimum)
162 data[0] = (R[2][1] - R[1][2]) / (2 * sinc);
163 data[1] = (R[0][2] - R[2][0]) / (2 * sinc);
164 data[2] = (R[1][0] - R[0][1]) / (2 * sinc);
168 if ( (R[0][0]-c) > std::numeric_limits<double>::epsilon() )
169 x = sqrt((R[0][0]-c)/(1-c));
172 if ( (R[1][1]-c) > std::numeric_limits<double>::epsilon() )
173 y = sqrt((R[1][1]-c)/(1-c));
176 if ( (R[2][2]-c) > std::numeric_limits<double>::epsilon() )
177 z = sqrt((R[2][2]-c)/(1-c));
181 if ((R[2][1]-R[1][2]) < 0) x = -x;
187 if((R[0][2]-R[2][0]) < 0) y = -y;
193 if((R[1][0]-R[0][1]) < 0) z = -z;
251 if (tu.size() != 3) {
255 for (
unsigned int i = 0; i < 3; i++)
266 if (tu.
size() != 3) {
270 for (
unsigned int i = 0; i < 3; i++)
299 for (
unsigned int i = 0; i <
dsize; i++)
334 for (
unsigned int i = 0; i <
size(); i++)
374 if (std::fabs(theta) <= std::numeric_limits<double>::epsilon()) {
378 for (
unsigned int i = 0; i < 3; i++)
379 u[i] =
data[i] / theta;
435 if (std::fabs(theta) <= std::numeric_limits<double>::epsilon()) {
439 for (
unsigned int i = 0; i < 3; i++)
440 u[i] =
data[i] / theta;
454 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) 474 if (list.size() >
size()) {
477 std::copy(list.begin(), list.end(),
data);
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.
void resize(unsigned int i, bool flagNullify=true)
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.
static int() sign(double x)
Implementation of a rotation vector as axis-angle minimal representation.