Frank Hess created MATH-846:
-------------------------------
Summary: Rotation constructor does wrong calculation
Key: MATH-846
URL: https://issues.apache.org/jira/browse/MATH-846
Project: Commons Math
Issue Type: Bug
Affects Versions: 3.0
Environment: Windows java 1.7r5
Reporter: Frank Hess
The following code produces the wrong result. The resulting Rotation is does
not even hold a normalized quaternion:
final Vector3D u1 = new Vector3D(1.0, 0.0, 0.0);
final Vector3D u2 = new Vector3D(1.0, -1.0, 0.0);
final Vector3D v1 = new Vector3D(0.9999999, 0., 0.0);
final Vector3D v2 = new Vector3D(0., 1., 0.0);
final Rotation rot = new Rotation(u1, u2, v1, v2);
System.err.println("rot quaternion: " + rot.getQ0() + " " + rot.getQ1() + " " +
rot.getQ2() + " " + rot.getQ3());
For me it outputs:
rot quaternion: 0.0 0.0 0.0 -7.450580596923828E-9
The correct output should have been:
rot quaternion: 0.0 1.0 0.0 0.0
The constructor seems to be hitting some kind of numerical instability.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira