The problem we are addressing here is the rotation of a general 3D vector about a given axis of rotation denoted by by radians.
The Rodrigues Rotation Formula is as follows:
Example: for a sanity check we can consider that will result in
Example:
Rotate about by .
import numpy as np v = np.array([2.,0.,0.]) n = np.array([0.,0.,1.]) theta = np.pi/2 vp = (1-np.cos(theta))*(np.dot(v,n))*n + np.cos(theta)*v + np.sin(theta)*(np.cross(n,v)) >>> vp array([1.2246468e-16, 2.0000000e+00, 0.0000000e+00])