I have a set of points, two of which I am using to designate my desired vector of rotation.
For example, let:
x1 = [1,1,1]
x2 = [2,3,1]
My desired rotation vector is:
x2 - x1 = [1,2,0]
I am then trying to rotate a series of 3D points relative to this rotation by a Rodrigues rotation, with my metho being:
def rodriguesRotation(vi, k, theta):
# Accepts vector and returns rotated vector.
vRotated = (vi * cos(theta)) + ((np.cross(vi, k)) * sin(theta) ) + (k * (np.dot(k, vi)) * (1 - cos(theta)) )
return vRotated
Where vi
is my unrotated vector, k
is my desired rotation vector, and theta
is my Euler angle of rotation. However, this is producing some strange results - I'm not sure if in Python I have to designate my unit vectors for this to work properly, and I believe the reason it is not working is simply because my k
is a 'point' and not a vector. Any advice?