Hello,
I have been experimenting with the Avogadro python interface and I have a
question. I am trying to rotate the whole molecule, and after googling a bit I
came up with a procedure that I think should work, but gives an error when I
run it.
To start with I used the GUI to build and minimize chloromethane, then I
entered this into the Python console:
>>> import Avogadro
>>> import numpy
>>> import math
>>> mol = Avogadro.molecule
>>> a = math.cos( math.radians(-30.0) )
>>> b = math.sin( math.radians(-30.0) )
>>> R = numpy.mat( [[a, -b, 0], [b, a, 0], [0,0,1]] )
>>> for a in mol.atoms:
... newpos = mol.atom(a.index).pos * R;
... newpos = newpos.T;
... mol.atom(a.index).pos = newpos
...
Traceback (most recent call last):
File "<string>", line 1, in <module>
SystemError: NULL result without error in PyObject_Call
>>>
Just to see if I could get something that works I picked an arbitrary angle of
-30 degrees. I am afraid that my matrix algebra skills are quite out of date
and I could be misunderstanding something simple about the mathematics or about
numpy.
Can anyone help me with this?
Thanks,
Steve
------------------------------------------------------------------------------
Got Input? Slashdot Needs You.
Take our quick survey online. Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
Avogadro-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/avogadro-devel