import numpy as np def rotation_matrix(axis,theta): axis = axis/np.sqrt(np.dot(axis,axis)) a = np.cos(theta/2) b,c,d = -axis*np.sin(theta/2) return np.array([[a*a+b*b-c*c-d*d, 2*(b*c-a*d), 2*(b*d+a*c)], [2*(b*c+a*d), a*a+c*c-b*b-d*d, 2*(c*d-a*b)], [2*(b*d-a*c), 2*(c*d+a*b), a*a+d*d-b*b-c*c]]) v = np.array([3,5,0]) axis = np.array([4,4,1]) theta = 1.2 print(np.dot(rotation_matrix(axis,theta),v)) # [ 2.74911638 4.77180932 1.91629719]
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.