[Numpy-discussion] Matrices and arrays of vectors

Pierre Haessig pierre.haessig at crans.org
Fri Feb 24 08:06:53 EST 2012


Hi,
Le 24/02/2012 13:55, Nicolas Rougier a écrit :
> You should use a (M,N,2) array to store your vectors:
> [...]
> [...]
> numpy.dot(data,rotation)
looking at how numpy.dot generalizes the matrix product* to N-dim
arrays, I came to the same conclusion.

I just suspect that the 'rotation' array should be transposed. (or flip
the sign of theta which is equivalent...)

Best,
Pierre

* from numpy.dot docstring :
""""
dot(a, b) Dot product of two arrays.

For N dimensions it is a sum product over the *last* axis of `a` and
the *second-to-last* of `b`::

    dot(a, b)[i,j,k,m] = sum(a[i,j,:] * b[k,:,m])
""""


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20120224/e9f45708/attachment.sig>


More information about the NumPy-Discussion mailing list