<span></span><div class="gmail_quote">2009/6/9 Charles R Harris <span dir="ltr"><<a href="mailto:charlesr.harris@gmail.com">charlesr.harris@gmail.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>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).</blockquote>
<div><br>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.<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> If you want more general rotations, a ufunc for quaternions would do the trick.<br>
</blockquote></div><span><span class="S1"><br>You mean something like Christoph Gohlke's "transformations.py" program ?<br><br>I'll also chek if I really ned vectorisation. After all, Numpy slicing is known to be efficient.<br>
<br>I'll do some timing with the pseudo-vectorial function :<br><br></span></span>def rotat_vect(phi, theta, psi, V):<br>    for i in xrange(len(phi)):<br>        rotat_scal(phi[i,:], theta[i,:], psi[i,:], V[i,:])<br>
<br><br>Bruno.<br>