public void testMatrixRoundtrip() {
for (int i = 0; i < 1000; i++) {
Quaternion q = Quaternion.createFromAxisAngle(Vec3D.randomVector(),
MathUtils.random(MathUtils.TWO_PI)).normalize();
Matrix4x4 m = q.toMatrix4x4();
Quaternion q2 = Quaternion.createFromMatrix(m);
Vec3D p = Vec3D.randomVector();
Vec3D p2 = p.copy();
q.applyTo(p);
q2.applyTo(p2);