Re: [Numpy-discussion] working on multiple matrices of the same shape

2008-11-25 Thread Stéfan van der Walt
2008/11/24 Sébastien Barthélemy <[EMAIL PROTECTED]>: > Are you sure ? Here it reports > ValueError: setting an array element with a sequence. > probably because theta, sintheta and costheta are 1-d arrays of n>1 elements. Sorry, I missed that detail. Cheers Stéfan

Re: [Numpy-discussion] working on multiple matrices of the same shape

2008-11-24 Thread Sébastien Barthélemy
>> def rotx(theta): >>""" >>SE(3) matrices corresponding to a rotation around x-axis. Theta is >> a 1-d array >>""" >>costheta = np.cos(theta) >>sintheta = np.sin(theta) >>H = np.zeros((theta.size,4,4)) >>H[:,0,0] = 1 >>H[:,3,3] = 1 >>H[:,1,1] = costheta >>H[

Re: [Numpy-discussion] working on multiple matrices of the same shape

2008-11-24 Thread Stéfan van der Walt
2008/11/21 Sébastien Barthélemy <[EMAIL PROTECTED]>: > In this spirit, in numpy a set of rotation matrices could be built in > the following way: > > def rotx(theta): >""" >SE(3) matrices corresponding to a rotation around x-axis. Theta is > a 1-d array >""" >costheta = np.cos(theta

Re: [Numpy-discussion] working on multiple matrices of the same shape

2008-11-21 Thread Charles R Harris
On Fri, Nov 21, 2008 at 2:57 AM, Sébastien Barthélemy <[EMAIL PROTECTED]>wrote: > Hello, > > I would like to port a matlab library which provides functions for > rigid body mechanics such as operations on homogeneous matrices (in > SE(3)), twists (in se(3)) and so. > > In matlab, the library worke

[Numpy-discussion] working on multiple matrices of the same shape

2008-11-21 Thread Sébastien Barthélemy
Hello, I would like to port a matlab library which provides functions for rigid body mechanics such as operations on homogeneous matrices (in SE(3)), twists (in se(3)) and so. In matlab, the library worked on 3d matrices: n homoneous matrices were stacked along the 3d dimension. This speeded up c