16 const Vector3D rotAngles = rotation.eulerAngles(2, 1, 0);
17 double sx = std::sin(rotAngles(2));
19 double sy = std::sin(rotAngles(1));
21 double sz = std::sin(rotAngles(0));
30 rotToLocalXAxis.col(0) =
Vector3D(0, 0, 0);
31 rotToLocalXAxis.col(1) =
Vector3D(-cz * sy, -sz * sy, -cy);
32 rotToLocalXAxis.col(2) =
Vector3D(-sz * cy, cz * cy, 0);
35 rotToLocalYAxis.col(0) =
36 Vector3D(cz * sy * cx + sz * sx, sz * sy * cx - cz * sx, cy * cx);
37 rotToLocalYAxis.col(1) =
Vector3D(cz * cy * sx, sz * cy * sx, -sy * sx);
38 rotToLocalYAxis.col(2) =
39 Vector3D(-sz * sy * sx - cz * cx, cz * sy * sx - sz * cx, 0);
42 rotToLocalZAxis.col(0) =
43 Vector3D(sz * cx - cz * sy * sx, -sz * sy * sx - cz * cx, -cy * sx);
44 rotToLocalZAxis.col(1) =
Vector3D(cz * cy * cx, sz * cy * cx, -sy * cx);
45 rotToLocalZAxis.col(2) =
46 Vector3D(cz * sx - sz * sy * cx, cz * sy * cx + sz * sx, 0);
48 return std::make_tuple(std::move(rotToLocalXAxis), std::move(rotToLocalYAxis),
49 std::move(rotToLocalZAxis));