Jeff, the problem is that you are using Jmol 11.8. No matrices there.
On Fri, Dec 4, 2009 at 2:58 AM, Jeffrey Tseng <[email protected]> wrote:
> Hi, Bob
>
> Given that
> > x = [ [1,2,3],[4,5,6],[7,8,9]]
> >
>
> > print x * {1 3 3}
>
> In Jmol
>
> $ print x * {1 3 3}
> 13.076697
>
> => I believe this number is not what users want.
>
>
I agree. In Jmol 11.9:
$ show _version
_version = 1109010
$ x = [ [1,2,3],[4,5,6],[7,8,9]]
$ print x * {1 3 3}
{16.0 37.0 58.0}
>
> then try {1 3 3} * x
>
> In Jmol
> $ print { 1 3 3} * x
> {3.0 9.0 9.0}
>
> => I believe this vector is not correct neither.
>
>
$ show _version
_version = 1109010
$ print x
[[1.0,2.0,3.0],[4.0,5.0,6.0],[7.0,8.0,9.0]]
$ print {1 3 3} * x
{34.0 41.0 48.0}
Also, you now have
m2 = !m (inversion)
m2 = -m (transposition)
>
> In Jmol
> $ print x * x
> 9.0
>
> => this is wrong
>
>
$ show _version
_version = 1109010
$ print x * x
[[30.0,36.0,42.0],[66.0,81.0,96.0],[102.0,126.0,150.0]]
$ show @x
[
[1.0 2.0 3.0]
[4.0 5.0 6.0]
[7.0 8.0 9.0] ]
$
$ show @{x * x}
[
[30.0 36.0 42.0]
[66.0 81.0 96.0]
[102.0 126.0 150.0] ]
$
That look better?
>
>
> > for row 3 you can use
> >
> > print x[3]
>
> In Jmol
> $ print x[3]
> 7
> 8
> 9
> => this print out col 3 intead of row 3
>
>
> no, that's row three. We are defining rows, not columns.
>
> >
> > or for column 1 use
> >
> > print x[-1]
>
> In Jmol
> $ print x[-1]
> 4
> 5
> 6
>
> => this print out col 2 instead of column 1
>
>
actually, that's row 3. The [-1] just says "take the last element of the
array", and in 11.8 you don't have matrices, just arrays. In Jmol 11.9 you
can address a specific matrix element the usual way (though 1-based):
$ show _version
_version = 1109010
$ print x
[[1.0,2.0,3.0],[4.0,5.0,6.0],[7.0,8.0,9.0]]
$ print x[2][3]
6.0
So the main problem here is:
1) You need to use Jmol 11.9.10, specifically the one at
http://chemapps.stolaf.edu/jmol/docs/examples-11/Jmol.zip)
2) You need to define rows, not columns.
3) Much of this latest matrix business is still not documented.
By the way, if you want to define a rotation matrix using columns -- which
makes sense, because those are the x, y, and z axes of the frame for the
rotated axes, you can actually do that, just indirectly. You only need the
first two columns. You define a quaternion first, then ask for its matrix
using %-9.
$ show _version
_version = 1109010
$ q1 = axisAngle({0 0 1}, 30)
$ print q1
{0.0 0.0 0.25881904 0.9659258}
$ m = q1%-9
$ print m
[[0.8660254,-0.5,0.0],[0.5,0.8660254,0.0],[0.0,0.0,0.99999994]]
$ m2 = quaternion(m.col(1), m.col(2))%-9
$ print m2
[[0.8660254,-0.5,0.0],[0.5,0.8660254,0.0],[0.0,0.0,0.99999994]]
That is, you can work specifically with rotational matrices in the context
of quaternions. This is very handy.
Bob
>
> Thanks
>
> Jeffrey
>
>
>
>
>
>
>
> >
> >
> > On Thu, Dec 3, 2009 at 6:32 PM, Jeffrey Tseng <[email protected]> wrote:
> >>
> >> Hello Bob
> >>
> >> Thanks for your tricks for effectively presenting protein surfaces by
> >> Jmol.
> >>
> >> I had a question about the transformation matrix in Jmol. I tried
> >> to use a pre-computed transformation matrix (3x3) to rotate and move
> >> protein1 and to superimpose protein2.
> >>
> >> However, there are some basic Jmol commands users should have known
> >> about before performing the transformation.
> >>
> >> 1. how to assign a column vector (a point) to a variable
> >> 2. how to assign a matrix (3x3) to a variable
> >> 3. how to operate a column wth a matrix
> >> 4. how to apply a matrix to a structure coordinate
> >>
> >> I try to find these solutions yet Jmol seems difficult to perform
> >> these operations, for example, the order in the multiplication of a
> >> vector and a matrix.
> >>
> >> Would you give an example in order to perform the matrix
> >> transformation regard above specifc questions ?
> >>
> >> Thanks for your kind help.
> >>
> >> Jeffrey
> >>
> >> --
> >> Yan Yuan Tseng, PhD
> >> (http://pocket.uchicago.edu/ytseng/)
> >> Wen-Hsuing Li's Lab
> >> Biological Sciences Collegiate Division
> >> University of Chicago
> >
> >
> >
> > --
> > Robert M. Hanson
> > Professor of Chemistry
> > St. Olaf College
> > 1520 St. Olaf Ave.
> > Northfield, MN 55057
> > http://www.stolaf.edu/people/hansonr
> > phone: 507-786-3107
> >
> >
> > If nature does not answer first what we want,
> > it is better to take what answer we get.
> >
> > -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
> >
>
>
>
> --
> Yan Yuan Tseng, PhD
> (http://pocket.uchicago.edu/ytseng/)
> Wen-Hsuing Li's Lab
> Biological Sciences Collegiate Division
> University of Chicago
>
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users