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'll also chek if I really ned vectorisation. After all, Numpy slicing is known to be efficient. I'll do some timing with the pseudo-vectorial function : def rotat_vect(phi, theta, psi, V): for i in xrange(len(phi)): rotat_scal(phi[i,:], theta[i,:], psi[i,:], V[i,:]) Bruno.
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion