But they are not identical: Point (1.0, 1.0, 1.0) goes into (0.0016, 0.0000, -1.7320) with my left-handed matrix, and to (1.4393, -0.1442, -0.9527) with Jmol's rotation.
If I multiply the rotation matrix with (-1) and thus make it right-handed. This is fine for me now, because I need only axes orientation, but not the direction. However, it could be something wrong with the switching to right-handed rotation algorithm. Thanks, Nick On 03/19/12 14:55, Robert Hanson wrote: > Your rot2 matrix is a left-handed axis system, not a right-handed one. > That matrix has a determinant of -1, not 1. > > Jmol is considering your left-handed matrix > > [-0.430167 -0.38484102 0.816611] > [0.693676 -0.719811 0.0261867] > [-0.57772803 -0.57772905 -0.57659] ] > > and the proper rotation > > [0.92022824 0.35561728 0.16345158] > [0.24758267 -0.8523756 0.46060687] > [0.3031219 -0.38339567 -0.8724247] ] > > to be identical rotations. > > > > On Mon, Mar 19, 2012 at 6:02 AM, Nikolay Bogdanov > <nikol.bogda...@gmail.com <mailto:nikol.bogda...@gmail.com>> wrote: > > Hi, > > I try to find out how to apply a rotation matrix to the model with > jmol. I have a matrix to be applied to coordinates this way: > matrix [[a1,b1,c1],[a2,b2,c2],[a3,b3,c3]] > xnew=a1*x+b1*y+c1*z, ynew=a2*x+b2*y+c2*z etc > > It looks like I need just to do $ rotate selected @matrix. But it > works for one matrix and doesn't with another (I've checked with > manually multiplied > coordinates). Then I decided to check how does jmol rotate > coordinates with matrix and found that in one case transformation > equal to matrix, and in > other not. The same, as for my models. > > Is it a bug, or a feature, and how can I get rotation for the second > matrix? > > > $ show transform > transform: > [ > [1.0 0.0 0.0] > [0.0 1.0 0.0] > [0.0 0.0 1.0] ] > $ show rot > rot = [ > [0.0444209 -0.23927301 0.969936] > [0.0448276 -0.969439 -0.24120401] > [0.998007 0.0541943 -0.0323373] ] > $ rotate @rot > $ show transform > transform: > [ > [0.044420823 -0.23927324 0.9699356] > [0.044827897 -0.9694386 -0.24120365] > [0.99800664 0.05419464 -0.032337148] ] > > ... rotate back > > $ show transform > transform: > [ > [1.0 0.0 0.0] > [0.0 1.0 0.0] > [0.0 0.0 1.0] ] > $ show rot2 > rot2 = [ > [-0.430167 -0.38484102 0.816611] > [0.693676 -0.719811 0.0261867] > [-0.57772803 -0.57772905 -0.57659] ] > $ rotate @rot2 > $ show transform > transform: > [ > [0.9202282 0.35561728 0.16345158] > [0.2475827 -0.85237557 0.46060684] > [0.3031219 -0.3833956 -0.8724247] ] > > Thanks, Nick > > > ------------------------------------------------------------------------------ > This SF email is sponsosred by: > Try Windows Azure free for 90 days Click Here > http://p.sf.net/sfu/sfd2d-msazure > _______________________________________________ > Jmol-users mailing list > Jmol-users@lists.sourceforge.net > <mailto:Jmol-users@lists.sourceforge.net> > https://lists.sourceforge.net/lists/listinfo/jmol-users > > > > > -- > 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 > > > > ------------------------------------------------------------------------------ > This SF email is sponsosred by: > Try Windows Azure free for 90 days Click Here > http://p.sf.net/sfu/sfd2d-msazure > > > > _______________________________________________ > Jmol-users mailing list > Jmol-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jmol-users ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users