我有其中包含一串点的数组(3D矢量,特别):使用numpy在一系列点上乘以一个矩阵?
pts = np.array([
[1, 1, 1],
[2, 2, 2],
[3, 3, 3],
[4, 4, 4],
[5, 5, 5],
])
而且我想通过变换矩阵相乘的那些点中的每一个:
pts[0] = np.dot(transform_matrix, pts[0])
pts[1] = np.dot(transform_matrix, pts[1])
…
pts[n] = np.dot(transform_matrix, pts[n])
我该如何有效地做到这一点?
太棒了,谢谢!另外,这是一个关于'einsum'的好消息 - 谢谢。 – 2014-10-10 01:07:56