47 #include <visp3/core/vpThetaUVector.h>
49 const double vpThetaUVector::minimum = 0.0001;
151 for(
unsigned int i=0; i<3; i++)
163 double s,c,theta,sinc;
165 s = (R[1][0]-R[0][1])*(R[1][0]-R[0][1])
166 + (R[2][0]-R[0][2])*(R[2][0]-R[0][2])
167 + (R[2][1]-R[1][2])*(R[2][1]-R[1][2]);
169 c = (R[0][0]+R[1][1]+R[2][2]-1.0)/2.0;
173 if ( (1+c) > minimum)
177 data[0] = (R[2][1]-R[1][2])/(2*sinc);
178 data[1] = (R[0][2]-R[2][0])/(2*sinc);
179 data[2] = (R[1][0]-R[0][1])/(2*sinc);
183 if ( (R[0][0]-c) < std::numeric_limits<double>::epsilon() )
186 data[0] = theta*(sqrt((R[0][0]-c)/(1-c)));
187 if ((R[2][1]-R[1][2]) < 0)
data[0] = -
data[0];
189 if ( (R[1][1]-c) < std::numeric_limits<double>::epsilon() )
192 data[1] = theta*(sqrt((R[1][1]-c)/(1-c)));
194 if ((R[0][2]-R[2][0]) < 0)
data[1] = -
data[1];
196 if ( (R[2][2]-c) < std::numeric_limits<double>::epsilon() )
199 data[2] = theta*(sqrt((R[2][2]-c)/(1-c)));
201 if ((R[1][0]-R[0][1]) < 0)
data[2] = -
data[2];
279 for (
unsigned int i=0; i<
dsize; i++)
303 if (std::fabs(theta) <= std::numeric_limits<double>::epsilon()) {
307 for (
unsigned int i=0 ; i < 3 ; i++)
308 u[i] = data[i] / theta ;
Implementation of a generic rotation vector.
Implementation of an homogeneous matrix and operations on such kind of matrices.
double * data
Address of the first element of the data 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.
vpThetaUVector & operator=(double x)
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)