aidapy.tools.vdf_utils module¶
-
aidapy.tools.vdf_utils.
R_2vect
(vector_orig, vector_fin)[source]¶ Taken from: https://github.com/Wallacoloo/printipi/blob/master/util/rotation_matrix.py Calculate the rotation matrix required to rotate from one vector to another. For the rotation of one vector to another, there are an infinit series of rotation matrices possible. Due to axially symmetry, the rotation axis can be any vector lying in the symmetry plane between the two vectors. Hence the axis-angle convention will be used to construct the matrix with the rotation axis defined as the cross product of the two vectors. The rotation angle is the arccosine of the dot product of the two unit vectors. Given a unit vector parallel to the rotation axis, w = [x, y, z] and the rotation angle a, the rotation matrix R is:
| 1 + (1-cos(a))*(x*x-1) -z*sin(a)+(1-cos(a))*x*y y*sin(a)+(1-cos(a))*x*z | R = | z*sin(a)+(1-cos(a))*x*y 1 + (1-cos(a))*(y*y-1) -x*sin(a)+(1-cos(a))*y*z | | -y*sin(a)+(1-cos(a))*x*z x*sin(a)+(1-cos(a))*y*z 1 + (1-cos(a))*(z*z-1) |
- Parameters
R – The 3x3 rotation matrix to update.
vector_orig – The unrotated vector defined in the reference frame.
vector_fin – The rotated vector defined in the reference frame.
-
aidapy.tools.vdf_utils.
init_grid
(v_max, resolution, grid_geom)[source]¶ Here we define the bin edges and centers, depending on the chosen coordinate system.