On Wed, Jun 10, 2009 at 12:21 AM, bruno Piguet <bruno.pig...@gmail.com>wrote:
> 2009/6/9 Charles R Harris <charlesr.har...@gmail.com> > >> >> Well, in this case you can use complex multiplication and either work with >> just the x,y components or use two complex components, i.e., [x + 1j*y, z]. >> In the first case you can then do the rotation as V*exp(1j*phi). > > > In the real case, it's a real 3-axes rotation, where M = dot (M1(psi), dot > (M2(theta), M3(phi))). The decomposition in 2D-rotations and the use of > complex operation is possible, but the matrix notation is more concise. > > If you want more general rotations, a ufunc for quaternions would do the >> trick. >> > > You mean something like Christoph Gohlke's "transformations.py" program ? > I don't know. But I think generating the rotation matrices is likely to be the bottleneck and I'm not sure how you want to specify them. After you have the stack of rotation matrices there are at least three ways to multiply them with stacks of vectors: in a python loop, using newaxis and a sum, or possibly a generalized ufunc. I'm not sure about the latter but I think there is an example that does that. Chuck
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion