I have a list (L1) of points and a rotation matrix (R1) made using numpy as shown below
L1 = [[1.1,2.3,-5.5],[3.4,2.0,3.0]]
R1 = [[ 0.99214145 -0.09280282 -0.08392241]
[-0.09280282 -0.09592336 -0.99105315]
[ 0.08392241 0.99105315 -0.10378191]]
I would like to rotate each point in L1 using R1, but instead of two points, I have >1000000 points in L1.
I have used the following code to do the rotations but they take in excess of 8 minutes for 30 lists like L1 and I would like to know if there is any faster way using numpy or any other module. Thank you so much.
#make new list of rotated points
rotatedpoints = []
#do the inverse rotation for each point in dome
for point in L1:
rotatedpoint = list((np.dot(R1, point)) )
rotatedpoints.append(rotatedpoint)