9 #include <boost/test/unit_test.hpp>
27 const double alpha = M_PI;
28 const double beta = 0;
29 const double gamma = M_PI / 2;
36 double sz = std::sin(gamma);
37 double cz = std::cos(gamma);
38 double sy = std::sin(beta);
39 double cy = std::cos(beta);
40 double sx = std::sin(alpha);
41 double cx = std::cos(alpha);
49 expRot.col(0) =
Vector3(cz * cy, cy * sz, -sy);
51 Vector3(cz * sy * sx - cx * sz, cz * cx + sz * sy * sx, cy * sx);
53 Vector3(sz * sx + cz * cx * sy, cx * sz * sy - cz * sx, cy * cx);
57 expRotToXAxis.col(0) =
Vector3(0, 0, 0);
58 expRotToXAxis.col(1) =
Vector3(-cz * sy, -sz * sy, -cy);
59 expRotToXAxis.col(2) =
Vector3(-sz * cy, cz * cy, 0);
63 expRotToYAxis.col(0) =
64 Vector3(cz * sy * cx + sz * sx, sz * sy * cx - cz * sx, cy * cx);
65 expRotToYAxis.col(1) =
Vector3(cz * cy * sx, sz * cy * sx, -sy * sx);
66 expRotToYAxis.col(2) =
67 Vector3(-sz * sy * sx - cz * cx, cz * sy * sx - sz * cx, 0);
71 expRotToZAxis.col(0) =
72 Vector3(sz * cx - cz * sy * sx, -sz * sy * sx - cz * cx, -cy * sx);
73 expRotToZAxis.col(1) =
Vector3(cz * cy * cx, sz * cy * cx, -sy * cx);
74 expRotToZAxis.col(2) =
75 Vector3(cz * sx - sz * sy * cx, cz * sy * cx + sz * sx, 0);
85 const auto rotation = transform.rotation();
92 const auto& [rotToLocalXAxis, rotToLocalYAxis, rotToLocalZAxis] =
109 const auto& [irotToLocalXAxis, irotToLocalYAxis, irotToLocalZAxis] =
113 expRotToXAxis << 0, 0, 0, 0, 0, 1, 0, -1, 0;
114 expRotToYAxis << 0, 0, -1, 0, 0, 0, 1, 0, 0;
115 expRotToZAxis << 0, 1, 0, -1, 0, 0, 0, 0, 0;