Warning, file /acts/Core/include/Acts/Utilities/TransformHelpers.hpp was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Definitions/Tolerance.hpp"
0013
0014 #include <cassert>
0015 #include <stdexcept>
0016
0017 namespace Acts {
0018
0019
0020
0021
0022
0023 inline bool isOrthogonal(const RotationMatrix3& rotation,
0024 double tolerance = s_transformEquivalentTolerance) {
0025 return (rotation * rotation.transpose())
0026 .isApprox(RotationMatrix3::Identity(), tolerance);
0027 }
0028
0029
0030
0031
0032
0033
0034 inline Transform3 makeTransform3(const RotationMatrix3& rotation,
0035 const Vector3& translation = Vector3::Zero()) {
0036 assert(isOrthogonal(rotation) &&
0037 "Transform3 requires an orthogonal rotation part");
0038 Transform3 transform = Transform3::Identity();
0039 transform.linear() = rotation;
0040 transform.translation() = translation;
0041 return transform;
0042 }
0043
0044
0045
0046
0047
0048 inline Transform3 makeTransform3(const AffineTransform3& transform) {
0049 if (!isOrthogonal(transform.linear())) {
0050 throw std::invalid_argument(
0051 "Affine transform is not a rigid transformation");
0052 }
0053 return makeTransform3(transform.linear(), transform.translation());
0054 }
0055
0056 }