[Chimera-users] Feature Request: Expose rotation to python
cwmoad at gmail.com
Mon Nov 28 10:48:57 PST 2005
Then would this be a practical solution:
On 11/28/05, Thomas Goddard <goddard at cgl.ucsf.edu> wrote:
> Hi Charlie,
> I second your request for having a Xform.getMatrix() method that
> provides 3x4 Numeric array or tuple of tuples.
> I use this a good bit. My solution is to use the Chimera
> PDBmatrices.matrices module which deals with 3x4 matrices where the
> first 3 columns are the rotation and the last column is the
> translation. It's been in Chimera for the last couple years
> (with ocassional changes).
> Look at Python code
> to see what is there.
> >>> xf = chimera.Xform.zRotation(30)
> >>> from PDBmatrices import matrices
> >>> m = matrices.xform_matrix(xf)
> >>> print m
> ((0.866025, -0.5, 0.0, 0.0),
> (0.5, 0.866025, 0.0, 0.0),
> (0.0, 0.0, 1.0, 0.0))
> There is a chimera_xform() routine to go from matrix to Xform, and
> other routines to apply 3x4 matrices to points, or vectors, invert matrices,
> multiply matrices, ....
More information about the Chimera-users