tfep.utils.geometry.rotation_matrix_3d
- tfep.utils.geometry.rotation_matrix_3d(angles, directions)[source]
Return the matrix rotating vectors for the given angle about a direction.
The rotation matrix is built using Rodrigues’ rotation formula.
- Parameters:
angles (torch.Tensor) – A tensor of shape
(batch_size,).directions (torch.Tensor) – A tensor of shape
(batch_size, 3)or(3,).
- Returns:
R –
R[i]is the 3 by 3 matrix rotating by the angleangles[i]about the vectordirections[i].- Return type:
torch.Tensor