Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## [Jmol-commits] SF.net SVN: jmol:[18991] trunk/Jmol/src/org/jmol

 [Jmol-commits] SF.net SVN: jmol:[18991] trunk/Jmol/src/org/jmol From: - 2013-11-21 18:46:58 ```Revision: 18991 http://sourceforge.net/p/jmol/code/18991 Author: hansonr Date: 2013-11-21 18:46:53 +0000 (Thu, 21 Nov 2013) Log Message: ----------- ___JmolVersion="13.3.9_dev_2013.11.21" undocumented feature: print quaternion([array of quaternions]) -- returns spherical mean ala Buss and Fillmore (http://www.math.ucsd.edu/~sbuss/ResearchWeb/spheremean/) new feature: print quaternion([array of quaternions], true) -- returns standard deviation for spherical mean ala Buss and Fillmore (http://www.math.ucsd.edu/~sbuss/ResearchWeb/spheremean/) Modified Paths: -------------- trunk/Jmol/src/org/jmol/util/Quaternion.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties Modified: trunk/Jmol/src/org/jmol/util/Quaternion.java =================================================================== --- trunk/Jmol/src/org/jmol/util/Quaternion.java 2013-11-21 17:11:24 UTC (rev 18990) +++ trunk/Jmol/src/org/jmol/util/Quaternion.java 2013-11-21 18:46:53 UTC (rev 18991) @@ -801,23 +801,15 @@ * @return standard deviation in units of degrees */ private static float stdDev(Quaternion[] data, Quaternion mean) { - double sum = 0; + // the quaternion dot product gives q0 for dq (i.e. q / mean) + // that is, cos(theta/2) for theta between them double sum2 = 0; int n = data.length; - // the quaternion dot product gives q0 for dq - // that is, cos(theta/2) for theta between them - for (int i = n; --i >= 0;) { - Quaternion dq = data[i].div(mean); - float theta = dq.getTheta(); - //System.out.println("stdDev " + dq + " "+ mean + " " + theta); - sum += theta; + float theta = data[i].div(mean).getTheta(); sum2 += theta * theta; } - sum2 = sum2 - sum * sum / n; - if (sum2 < 0) - sum2 = 0; - return (float) Math.sqrt(sum2 / (n - 1)); + return (float) Math.sqrt(sum2 / n); } public float[] getEulerZYZ() { Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2013-11-21 17:11:24 UTC (rev 18990) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2013-11-21 18:46:53 UTC (rev 18991) @@ -19,7 +19,7 @@ new feature: print quaternion([array of quaternions], true) -- returns standard deviation for spherical mean ala Buss and Fillmore (http://www.math.ucsd.edu/~sbuss/ResearchWeb/spheremean/) - + bug fix: print userfunc() may fail (userfunc() by itself is fine) new feature: named quaternion modulus values This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ```