EULER RzRyRz METHOD
The following algorithm generates angles Rz1, Ry, and Rz2, such that
rotate z <Rz1>; rotate y <Ry>; rotate z <Rz2>
reproduces the current view.
m<x><y> are matrix elements of the current Jmol transformation matrix.
Ry=acos(m22)
if(m22==-1||m22==1){
Rz1=atan2(m10,m11)
Rz2=0
}else{
Rz1=atan2(m21,-m20)
Rz2=atan2(m12,m02)
}
this logic pushes all the rotation into Rz1 when Ry=0 or Ry=180
------------------------------------------------------------------
RxRyRz METHOD
The following algorithm generates angles Rx, Ry, and Rz, such that
rotate x <Rx>; rotate y <Ry>; rotate z <Rz>
reproduces the current view.
m<x><y> are matrix elements of the current Jmol transformation matrix.
Ry=-asin(m20)
if(m20==-1||m20==1){
Rx=-atan2(m12,m11)
Rz=0
}else{
Rx=atan2(m21,m22)
Rz=atan2(m10,m00)
}
this logic pushes all the rotation into Rx when Ry=+/-90
Spreadsheet random input validation is at
http://www.stolaf.edu/people/hansonr/jmol/test/transform.xls
Bob Hanson
--
Robert M. Hanson, [EMAIL PROTECTED], 507-646-3107
Professor of Chemistry, St. Olaf College 1520 St. Olaf Ave., Northfield, MN 55057
mailto:[EMAIL PROTECTED] http://www.stolaf.edu/people/hansonr
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Jmol-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-developers