Numeric question, putting one matrix into another 
Author Message
 Numeric question, putting one matrix into another

Hello,

Using Numeric-arrays I have made a (3x3) rotation-matrix. Now I would like to put this rotation
matrix in a (4x4) transformation matrix. I believe I have to use the put function (the alternative
would be assigning each element of the matrix the proper value), but if so I don't get the indices
set properly. Am I just not bright enought  or is this the wrong approach?

Regards,

Jorn

--
Jorn Verwey
PSI - Life Sciences WMSA/B14
CH 5232 Villigen PSI
Switzerland
tel. +41 56 310 4246
fax. +41 56 310 3132     -o)




Mon, 15 Sep 2003 18:23:26 GMT  
 Numeric question, putting one matrix into another

Quote:

> Using Numeric-arrays I have made a (3x3) rotation-matrix. Now I would like to put this rotation
> matrix in a (4x4) transformation matrix.

That's easy:

   rotation = Numeric.zeros((3,3), Numeric.Float)
   transformation = Numeric.zeros((4,4), Numeric.Float)

   transformation[:3, :3] = rotation

BTW, you might be interested in the module
Scientific.Geometry.Transformation, which is part of Scientific python
(http://starship.python.net/crew/hinsen/scientific.html). It handles
linear transformations with some added luxury.
--
-------------------------------------------------------------------------------

Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------



Mon, 15 Sep 2003 18:40:30 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. MATRIX [G -> NUMERIC]

2. how do I put matrix into text file?

3. is the value a numeric one?

4. putting one record into a file

5. Can I put this on one floppy disk?

6. Can one put a checkbox inside a browse

7. Problem putting more than one AVI into VO 2.0a-1 APP

8. How I can put in order one array

9. putting severall arrays into one, and back again

10. putc (putting exactly one character).

11. PUTTING THE LOT IN ONE FILE

12. how to use the rotation matrix when rotating on more than one axis

 

 
Powered by phpBB® Forum Software