47 #include <visp3/core/vpThetaUVector.h>
49 const double vpThetaUVector::minimum = 0.0001;
66 for (
unsigned int i=0; i< 3; i++)
161 for(
unsigned int i=0; i<3; i++)
175 s = (R[1][0]-R[0][1])*(R[1][0]-R[0][1])
176 + (R[2][0]-R[0][2])*(R[2][0]-R[0][2])
177 + (R[2][1]-R[1][2])*(R[2][1]-R[1][2]);
179 c = (R[0][0]+R[1][1]+R[2][2]-1.0)/2.0;
183 if ( (1+c) > minimum)
187 data[0] = (R[2][1]-R[1][2])/(2*sinc);
188 data[1] = (R[0][2]-R[2][0])/(2*sinc);
189 data[2] = (R[1][0]-R[0][1])/(2*sinc);
193 if ( (R[0][0]-c) < std::numeric_limits<double>::epsilon() )
196 data[0] = theta*(sqrt((R[0][0]-c)/(1-c)));
197 if ((R[2][1]-R[1][2]) < 0)
data[0] = -
data[0];
199 if ( (R[1][1]-c) < std::numeric_limits<double>::epsilon() )
202 data[1] = theta*(sqrt((R[1][1]-c)/(1-c)));
204 if ((R[0][2]-R[2][0]) < 0)
data[1] = -
data[1];
206 if ( (R[2][2]-c) < std::numeric_limits<double>::epsilon() )
209 data[2] = theta*(sqrt((R[2][2]-c)/(1-c)));
211 if ((R[1][0]-R[0][1]) < 0)
data[2] = -
data[2];
289 for (
unsigned int i=0; i<
dsize; i++)
318 if (tu.
size() != 3) {
321 for (
unsigned int i=0; i< 3; i++)
362 if (std::fabs(theta) <= std::numeric_limits<double>::epsilon()) {
366 for (
unsigned int i=0 ; i < 3 ; i++)
367 u[i] =
data[i] / theta ;
424 if (std::fabs(theta) <= std::numeric_limits<double>::epsilon()) {
428 for (
unsigned int i=0 ; i < 3 ; i++)
429 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.
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.
vpThetaUVector buildFrom(const vpHomogeneousMatrix &M)
static double sinc(double x)
Implementation of a rotation matrix and operations on such kind of matrices.
void extract(double &theta, vpColVector &u) const
void extract(vpRotationMatrix &R) const
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)