I have an array that contains a bunch of points (in particular, 3D vectors):
pts = np.array([ [1, 1, 1], [2, 2, 2], [3, 3, 3], [4, 4, 4], [5, 5, 5], ])
And I would like to multiply each of these points by a transformation matrix:
pts[0] = np.dot(transform_matrix, pts[0]) pts[1] = np.dot(transform_matrix, pts[1]) … pts[n] = np.dot(transform_matrix, pts[n])
How can I do this efficiently?
source share