From: <ha...@us...> - 2010-03-11 13:11:27
|
Revision: 12603 http://jmol.svn.sourceforge.net/jmol/?rev=12603&view=rev Author: hansonr Date: 2010-03-11 13:11:20 +0000 (Thu, 11 Mar 2010) Log Message: ----------- version=11.9.33_dev # new feature: quaterion array .average .stddev using SphereMean Modified Paths: -------------- trunk/Jmol/src/org/jmol/util/Quaternion.java Modified: trunk/Jmol/src/org/jmol/util/Quaternion.java =================================================================== --- trunk/Jmol/src/org/jmol/util/Quaternion.java 2010-03-11 13:10:17 UTC (rev 12602) +++ trunk/Jmol/src/org/jmol/util/Quaternion.java 2010-03-11 13:11:20 UTC (rev 12603) @@ -695,8 +695,6 @@ } private static Quaternion newMean(Quaternion[] data, Quaternion mean) { - Vector3f sum = new Vector3f(); - float theta; /* quaternion derivatives nicely take care of producing the necessary * metric. Since dq gives us the normal with the smallest POSITIVE angle, * we just scale by that -- using degrees. @@ -724,11 +722,11 @@ * This is officially an "exponential" or "hyperbolic" projection. * */ + Vector3f sum = new Vector3f(); for (int i = data.length; --i >= 0;) { Quaternion dq = data[i].div(mean); Vector3f v = dq.getNormal(); - theta = dq.getTheta(); - v.scale(theta / data.length); + v.scale(dq.getTheta() / data.length); sum.add(v); } Quaternion dqMean = new Quaternion(sum, sum.length()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |