Previous version updates:
• Version 5.0 to Version 5.1 • Version 5.1 to Version 5.2 • Version 5.2 to Version 5.3 • Version 5.3 to Version 5.4 • Version 5.4 to Version 5.5 • Version 5.5 to Version 5.6 • Version 5.6 to Version 5.7 • Version 5.7 to Version 5.8 • Version 5.8 to Version 5.9 • Version 5.9 to Version 5.10 • Version 5.10 to Version 5.11 • Version 5.11 to Version 5.12 July 25, 2014. The document is missing a definition for the vector D, which is D = B-C. July 9, 2014. The initial angle was computed using acos, but this can generate an angle in the wrong quadrant. The call was replaced by atan2 and the initial minimum and maximum angles were adjusted accordingly. This code is quite old and uses the opposite convention for factoring a symmetric matrix M. In other parts of the engine, M = R*D*R^T, where R is a rotation, D is diagonal, and R^T is the transpose of R. The columns of R are the eigenvectors of M. In this old code, the factoring is M = R^T*D*R, so the rows of R are the eigenvectors (the ellipse axis directions). Unfortunately, this caused the extents e0 and e1 in the constructor to be incorrectly computed, because the columns were used for the axis directions. Moreover, the MakeRotation call needs to be passed the negative of the minimizing angle (pass -vMin[4] instead of vMin[4]). Finally, the Energy function had two wrongs that made it right! The code was modified to be consistent with the (old) convention: The matrix construction is now passed -input[4] rather than input[4] and the diff*rotate becomes rotate*diff. (Thanks to Andrew Cunningham for reporting unexpected results with this code, which led to the fixes and the update of the new symmetric eigensolver.) The symmetric eigensolver can return an eigenvector matrix that is a rotation or a reflection. Without sorting, the matrix is a rotation whenever the size is even; otherwise, it is a reflection. With sorting, however, the type of the matrix depends on the permutation of columns induced by the sorting. Added code to track the permutations, and added IsRotation() to report the type of matrix. Before new symmetric eigensolver, EigenDecomposition kept track of the permutations correctly. The new code broke that, hence the need for IsRotation(). Fixed several cut-and-paste errors where variables involving z instead were using y. (Thanks to LiuXu for reporting the errors.) |