rodrigues1
esta.general.rodrigues1
¶
get_rotation_matrix_rodrigues(input_uvec, required_uvec_direction=None)
¶
rotate a vector about an arbitray axis by some angle theta so as to align it along x/y/z axis by using Rodrigues's formula
Or find the rotation matrix using Rodrigues formula (both points are same!!)
Parameters:
-
input_uvec
–3D unit vector (non-unit vector should also work, e.g. for the case of atomic positions)
-
required_uvec_direction
–required unit vector direction, default is x-axis
Returns:
-
R
(array of rank2
) –rotation matrix for rotating the input_vec along the input direction
-
----------------
– -
The Rodrigues rotation formula gives us the following way to rotate a vector v⃗ by some angle θ about an arbitrary axis k⃗
– -
v⃗ rot=v⃗ cos(θ)+(k⃗ ×v⃗ )sin(θ)+k⃗ (k⃗ ⋅v⃗ )(1−cosθ)
– -
Let's call this the "vector notation" There is also a way to obtain the corresponding rotation matrix R
– -
, as such:
– -
R=I+(sinθ)K+(1−cosθ)K2
– -
↓
– -
v⃗ rot=Rv⃗
– -
where K
– -
is the cross-product matrix of the rotation axis:
– -
K=⎛⎝⎜0kz−ky−kz0kxky−kx0⎞⎠⎟
– -
See here: https://math.stackexchange.com/questions/2828802/angle-definition-confusion-in-rodrigues-rotation-matrix
–