[Numpy-discussion] Iterative Matrix Multiplication

Charles R Harris charlesr.harris@gmail....
Sun Feb 28 21:08:55 CST 2010


On Sun, Feb 28, 2010 at 7:58 PM, Ian Mallett <geometrian@gmail.com> wrote:

> On Sun, Feb 28, 2010 at 6:54 PM, Charles R Harris <
> charlesr.harris@gmail.com> wrote:
>
>> Why not just add a vector to get translation? There is no need to go the
>> homogeneous form. Or you can just leave the vectors at length 4 and use a
>> slice to access the first three components. That way you can leave the ones
>> in place.
>>
> Oh . . . duh :D
>
> Excellent--and a 3D rotation matrix is 3x3--so the list can remain n*3.
> Now the question is how to apply a rotation matrix to the array of vec3?
>

It looks like you want something like

res = dot(vec, rot) + tran

You can avoid an extra copy being made by separating the parts

res = dot(vec, rot)
res += tran

where I've used arrays, not matrices. Note that the rotation matrix
multiplies every vector in the array.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100228/00d81ccb/attachment.html 


More information about the NumPy-Discussion mailing list