File indexing completed on 2025-08-06 08:10:28
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "Acts/Surfaces/detail/AlignmentHelper.hpp"
0010
0011 #include <algorithm>
0012 #include <cmath>
0013 #include <utility>
0014
0015 Acts::detail::RotationToAxes Acts::detail::rotationToLocalAxesDerivative(
0016 const RotationMatrix3& rotation) {
0017
0018
0019
0020 const Vector3 rotAngles = rotation.eulerAngles(2, 1, 0);
0021 double sx = std::sin(rotAngles(2));
0022 double cx = std::cos(rotAngles(2));
0023 double sy = std::sin(rotAngles(1));
0024 double cy = std::cos(rotAngles(1));
0025 double sz = std::sin(rotAngles(0));
0026 double cz = std::cos(rotAngles(0));
0027
0028
0029
0030
0031
0032
0033 RotationMatrix3 rotToLocalXAxis = RotationMatrix3::Zero();
0034 rotToLocalXAxis.col(0) = Vector3(0, 0, 0);
0035 rotToLocalXAxis.col(1) = Vector3(-cz * sy, -sz * sy, -cy);
0036 rotToLocalXAxis.col(2) = Vector3(-sz * cy, cz * cy, 0);
0037
0038 RotationMatrix3 rotToLocalYAxis = RotationMatrix3::Zero();
0039 rotToLocalYAxis.col(0) =
0040 Vector3(cz * sy * cx + sz * sx, sz * sy * cx - cz * sx, cy * cx);
0041 rotToLocalYAxis.col(1) = Vector3(cz * cy * sx, sz * cy * sx, -sy * sx);
0042 rotToLocalYAxis.col(2) =
0043 Vector3(-sz * sy * sx - cz * cx, cz * sy * sx - sz * cx, 0);
0044
0045 RotationMatrix3 rotToLocalZAxis = RotationMatrix3::Zero();
0046 rotToLocalZAxis.col(0) =
0047 Vector3(sz * cx - cz * sy * sx, -sz * sy * sx - cz * cx, -cy * sx);
0048 rotToLocalZAxis.col(1) = Vector3(cz * cy * cx, sz * cy * cx, -sy * cx);
0049 rotToLocalZAxis.col(2) =
0050 Vector3(cz * sx - sz * sy * cx, cz * sy * cx + sz * sx, 0);
0051
0052 return std::make_tuple(std::move(rotToLocalXAxis), std::move(rotToLocalYAxis),
0053 std::move(rotToLocalZAxis));
0054 }