13 template <
class FLOAT>
15 const FLOAT *tr, std::vector<double> &tfo)
18 double rotData[9] = {1., 0., 0., 0., 1., 0., 0., 0., 1.};
24 const double ca = std::cos(ra[0]), sa = std::sin(ra[0]);
25 double rotX[9] = {1., 0., 0., 0., ca, -sa, 0., sa, ca};
32 const double ca = std::cos(ra[1]), sa = std::sin(ra[1]);
33 double rotY[9] = {ca, 0., sa, 0., 1., 0., -sa, 0., ca};
40 const double ca = std::cos(ra[2]), sa = std::sin(ra[2]);
41 double rotZ[9] = {ca, -sa, 0., sa, ca, 0., 0, 0, 1.};
46 double rotCenterData[3] = {rc[0], rc[1], rc[2]};
49 rot.
mult(rotCenter, dispRot);
51 for(
int i = 0; i < 3; i++) disp[i] = tr[i] + rc[i] - dispRot(i);
56 for(
int i = 0; i < 3; i++) {
57 for(
int j = 0; j < 3; j++) tfo.push_back(rot(i, j));
58 tfo.push_back(disp[i]);
60 for(
int i = 0; i < 3; i++) tfo.push_back(0.);
69 std::vector<double> &tfo);
72 std::vector<double> &tfo);
74 template <
class FLOAT>
76 FLOAT *rc, FLOAT *ra, FLOAT *tr)
79 ra[0] = std::atan2(-tfo[2 * 4 + 1], tfo[2 * 4 + 2]);
80 ra[1] = std::asin(tfo[2 * 4 + 0]);
81 ra[2] = std::atan2(-tfo[1 * 4 + 0], tfo[0 * 4 + 0]);
84 for(
int i = 0; i < 3; i++) rc[i] = 0.;
85 for(
int i = 0; i < 3; i++) tr[i] = tfo[4 * i + 3];
95 double *rc,
double *ra,
99 std::vector<double> &newTfo)
102 for(
int i = 0; i < 4; i++)
103 for(
int j = 0; j < 4; j++) inv(i, j) = tfo[i * 4 + j];
106 for(
int i = 0; i < 4; i++)
107 for(
int j = 0; j < 4; j++) newTfo.push_back(inv(i, j));
114 for(
int i = 0; i < 16; i += 5) tfo[i] = 1;