44 #include <visp3/core/vpRzyxVector.h>
94 const unsigned int index_0 = 0;
95 const unsigned int index_1 = 1;
96 const unsigned int index_2 = 2;
97 double nx = R[index_0][index_0];
98 double ny = R[index_1][index_0];
100 double COEF_MIN_ROT = 1e-6;
103 if ((fabs(nx) < COEF_MIN_ROT) && (fabs(ny) < COEF_MIN_ROT)) {
109 double si = sin(phi);
110 double co = cos(phi);
112 double nz = R[index_2][index_0];
113 double theta = atan2(-nz, (co * nx) + (si * ny));
115 double ax = R[index_0][index_2];
116 double ay = R[index_1][index_2];
117 double ox = R[index_0][index_1];
118 double oy = R[index_1][index_1];
120 double psi = atan2((si * ax) - (co * ay), (-si * ox) + (co * oy));
150 const unsigned int index_0 = 0;
151 const unsigned int index_1 = 1;
152 const unsigned int index_2 = 2;
154 data[index_1] = theta;
164 if (rzyx.
size() != 3) {
168 const unsigned int val_3 = 3;
169 for (
unsigned int i = 0; i < val_3; ++i) {
181 if (rzyx.size() != 3) {
185 const unsigned int val_3 = 3;
186 for (
unsigned int i = 0; i < val_3; ++i) {
218 for (
unsigned int i = 0; i <
dsize; ++i) {
253 if (rzyx.
size() != 3) {
257 const unsigned int val_3 = 3;
258 for (
unsigned int i = 0; i < val_3; ++i) {
265 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
289 if (list.size() >
size()) {
292 "Cannot set Euler x-y-z vector out of bounds. It has only %d values while you try to initialize with %d values",
293 size(), list.size()));
295 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.
vpRzyxVector & operator=(const vpColVector &rzyx)
vpRzyxVector & buildFrom(const vpRotationMatrix &R)
Implementation of a rotation vector as axis-angle minimal representation.