This Wikipedia article gives you a good overview for rotation matrices and this post gives you a simple example in PyTorch, which could be a good starter. 
This Wikipedia article gives you a good overview for rotation matrices and this post gives you a simple example in PyTorch, which could be a good starter. 