12#include "detray/definitions/algebra.hpp"
13#include "detray/definitions/detail/qualifiers.hpp"
14#include "detray/definitions/math.hpp"
20template <concepts::algebra algebra_t>
30 template <std::
size_t ROWS, std::
size_t COLS>
44 auto I = matrix::identity<matrix_type<3, 3>>();
48 R = cos_theta * I + math::sin(theta) * axis_cross +
49 (1.f - cos_theta) * axis_outer;
54 template <
typename vector3_t>
57 DETRAY_HOST_DEVICE vector3_t
operator()(
const vector3_t& v)
const {
68template <concepts::algebra algebra_t>
90 DETRAY_HOST_DEVICE std::pair<vector3_type, vector3_type>
operator()()
const {
93 auto new_x = axis_rot_alpha(
x);
97 const auto new_z = axis_rot_beta(
z);
100 new_x = axis_rot_gamma(new_x);
102 return std::make_pair(new_x, new_z);
111 const auto new_x = axis_rot_alpha(
x);
112 const auto v1 = axis_rot_alpha(v0);
116 const auto new_z = axis_rot_beta(
z);
117 const auto v2 = axis_rot_beta(v1);
121 const auto v3 = axis_rot_gamma(v2);
Definition concepts.hpp:98
Definition concepts.hpp:65
Detray include(s).
Definition array_operators.hpp:18
get_scalar_t< A, T > dscalar
Scalar type for algebra A and value type T.
Definition algebra.hpp:64
get_vector3D_t< A, T > dvector3D
Three-dimensional vector type for algebra A and value type T.
Definition algebra.hpp:80
get_matrix_t< A, R, C, T > dmatrix
R by C matrix type for algebra A and value type T.
Definition algebra.hpp:88
Helper struct to rotate a vector around a given axis and angle counterclockwisely.
Definition axis_rotation.hpp:21
dscalar< algebra_t > scalar_type
Scalar type used for the rotation angle and matrix entries.
Definition axis_rotation.hpp:26
algebra_t algebra_type
Algebra backend used for the rotation.
Definition axis_rotation.hpp:24
dmatrix< algebra_t, ROWS, COLS > matrix_type
Matrix type used to represent the rotation.
Definition axis_rotation.hpp:31
axis_rotation(const vector3_type &axis, const scalar_type theta)
Constructor for axis rotation.
Definition axis_rotation.hpp:38
dvector3D< algebra_t > vector3_type
Three-dimensional vector type rotated by this helper.
Definition axis_rotation.hpp:28
Helper struct to perform an euler rotation for a given vector All rotation operations are countercloc...
Definition axis_rotation.hpp:69
algebra_t algebra_type
Algebra backend used for the rotations.
Definition axis_rotation.hpp:72
scalar_type beta
Second rotation angle, about the rotated x axis.
Definition axis_rotation.hpp:85
dscalar< algebra_t > scalar_type
Scalar type used for the Euler angles.
Definition axis_rotation.hpp:74
scalar_type gamma
Third rotation angle, about the twice-rotated z axis.
Definition axis_rotation.hpp:87
vector3_type x
Following the z-x-z convention.
Definition axis_rotation.hpp:79
std::pair< vector3_type, vector3_type > operator()() const
Definition axis_rotation.hpp:90
vector3_type z
Initial z axis used to construct the rotated frame.
Definition axis_rotation.hpp:81
scalar_type alpha
First rotation angle, about the initial z axis.
Definition axis_rotation.hpp:83
vector3_type operator()(const vector3_type &v0) const
Apply the z-x-z Euler rotations to a vector.
Definition axis_rotation.hpp:108
dvector3D< algebra_t > vector3_type
Three-dimensional vector type used for the axes and input.
Definition axis_rotation.hpp:76