43 #include <visp3/core/vpRxyzVector.h>
46 const unsigned int vpRxyzVector::constr_val_3 = 3;
91 double COEF_MIN_ROT = 1e-6;
93 const unsigned int index_0 = 0;
94 const unsigned int index_1 = 1;
95 const unsigned int index_2 = 2;
97 if ((fabs(R[index_1][index_2]) < COEF_MIN_ROT) && (fabs(R[index_2][index_2]) < COEF_MIN_ROT)) {
101 phi = atan2(-R[index_1][index_2], R[index_2][index_2]);
104 double si = sin(phi);
105 double co = cos(phi);
106 double theta = atan2(R[index_0][index_2], (-si * R[index_1][index_2]) + (co * R[index_2][index_2]));
107 double psi = atan2((co * R[index_1][index_0]) + (si * R[index_2][index_0]), (co * R[index_1][index_1]) + (si * R[index_2][index_1]));
137 const unsigned int index_0 = 0;
138 const unsigned int index_1 = 1;
139 const unsigned int index_2 = 2;
141 data[index_1] = theta;
151 const unsigned int val_3 = 3;
152 if (rxyz.
size() != val_3) {
156 for (
unsigned int i = 0; i < val_3; ++i) {
168 const unsigned int val_3 = 3;
169 if (rxyz.size() != val_3) {
173 for (
unsigned int i = 0; i < val_3; ++i) {
205 for (
unsigned int i = 0; i <
dsize; ++i) {
240 const unsigned int val_3 = 3;
241 if (rxyz.
size() != val_3) {
245 for (
unsigned int i = 0; i < val_3; ++i) {
252 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
276 if (list.size() >
size()) {
279 "Cannot set Euler x-y-z vector out of bounds. It has only %d values while you try to initialize with %d values",
280 size(), list.size()));
282 std::copy(list.begin(), list.end(),
data);
double * data
Address of the first element of the data array.
unsigned int dsize
Current array size (rowNum * colNum)
unsigned int size() const
Return the number of elements of the 2D array.
Implementation of column vector and the associated operations.
error that can be emitted by ViSP classes.
@ dimensionError
Bad dimension.
Implementation of a rotation matrix and operations on such kind of matrices.
vpRotationMatrix & buildFrom(const vpHomogeneousMatrix &M)
Implementation of a generic rotation vector.
Implementation of a rotation vector as Euler angle minimal representation.
vpRxyzVector & operator=(const vpColVector &rxyz)
vpRxyzVector & buildFrom(const vpRotationMatrix &R)
Implementation of a rotation vector as axis-angle minimal representation.