From: <ha...@us...> - 2008-11-25 22:00:13
|
Revision: 10366 http://jmol.svn.sourceforge.net/jmol/?rev=10366&view=rev Author: hansonr Date: 2008-11-25 21:34:13 +0000 (Tue, 25 Nov 2008) Log Message: ----------- 11.6.7 VERSION Modified Paths: -------------- branches/v11_6/Jmol/src/org/jmol/modelsetbio/BioPolymer.java branches/v11_6/Jmol/src/org/jmol/viewer/Jmol.properties Modified: branches/v11_6/Jmol/src/org/jmol/modelsetbio/BioPolymer.java =================================================================== --- branches/v11_6/Jmol/src/org/jmol/modelsetbio/BioPolymer.java 2008-11-25 21:30:36 UTC (rev 10365) +++ branches/v11_6/Jmol/src/org/jmol/modelsetbio/BioPolymer.java 2008-11-25 21:34:13 UTC (rev 10366) @@ -693,7 +693,7 @@ */ q = dq.rightDifference(dqprev); //q = dq.mul(dqprev.inv()); if (ctype == 's') - a.getGroup().setStraightness(getStraightness(id, dqprev, dq)); + a.getGroup().setStraightness(getQuaternionStraightness(id, dqprev, dq)); } dqprev = dq; } @@ -793,19 +793,13 @@ } } - private static float getStraightness(String id, Quaternion dqprev, Quaternion dq) { - //System.out.println(id + " " + dqprev.getTheta() + " " + dq.getTheta()); - //float f = (float) (Math.acos(dqprev.getNormal().dot(dq.getNormal()))/ Math.PI); - //return 1 - 2 * f; - // absolute value added, because we are dotting the vector normals. Two vector normals - // that are colinear, despite their angle of rotation, should give the same straightness + private static float getQuaternionStraightness(String id, Quaternion dqprev, Quaternion dq) { // - // straightness = 1 - acos(|n1.n2|)/(PI/2) + // Dan Kohler's quaternion straightness = 1 - acos(|dq1.dq2|)/(PI/2) // // alignment = near 0 or near 180 --> same - just different rotations. // It's a 90-degree change in direction that corresponds to 0. // - float f = (float) (Math.acos(Math.abs(dqprev.getNormal().dot(dq.getNormal())))/ Math.PI); - return 1 - 2 * f; + return (float) (1 - 2 * Math.acos(Math.abs(dqprev.dot(dq))) / Math.PI); } } Modified: branches/v11_6/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- branches/v11_6/Jmol/src/org/jmol/viewer/Jmol.properties 2008-11-25 21:30:36 UTC (rev 10365) +++ branches/v11_6/Jmol/src/org/jmol/viewer/Jmol.properties 2008-11-25 21:34:13 UTC (rev 10366) @@ -1,8 +1,9 @@ # Developers: to add a description of changes you have made, # add it on a line starting with # below the "version=..." line -version=11.6.7_dev +version=11.6.7 +# quaternion straightness update # bug fix: applet improperly reporting status of "quiet" commands # bug fix: stereo not in state # bug fix: stereoDegrees parameter not reported correctly This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |