90 const unsigned int index_0 = 0;
91 const unsigned int index_1 = 1;
92 const unsigned int index_2 = 2;
93 double nx = R[index_0][index_0];
94 double ny = R[index_1][index_0];
96 double COEF_MIN_ROT = 1e-6;
99 if ((fabs(nx) < COEF_MIN_ROT) && (fabs(ny) < COEF_MIN_ROT)) {
105 double si = sin(phi);
106 double co = cos(phi);
108 double nz = R[index_2][index_0];
109 double theta = atan2(-nz, (co * nx) + (si * ny));
111 double ax = R[index_0][index_2];
112 double ay = R[index_1][index_2];
113 double ox = R[index_0][index_1];
114 double oy = R[index_1][index_1];
116 double psi = atan2((si * ax) - (co * ay), (-si * ox) + (co * oy));