Rotation implements Serializable { public Rotation revert() { return new Rotation(-q0, q1, q2, q3, false); } Rotation(double q0, double q1, double q2, double q3,
                  boolean needsNormalization);  Rotation(Vector3D axis, double angle);  Rotation(double[][] m, double threshold);  Rotation(Vector3D u1, Vector3D u2, Vector3D v1, Vector3D v2);  Rotation(Vector3D u, Vector3D v);  Rotation(RotationOrder order,
                  double alpha1, double alpha2, double alpha3); Rotation revert(); double getQ0(); double getQ1(); double getQ2(); double getQ3(); Vector3D getAxis(); double getAngle(); double[] getAngles(RotationOrder order); double[][] getMatrix(); Vector3D applyTo(Vector3D u); void applyTo(final double[] in, final double[] out); Vector3D applyInverseTo(Vector3D u); void applyInverseTo(final double[] in, final double[] out); Rotation applyTo(Rotation r); Rotation applyInverseTo(Rotation r); static double distance(Rotation r1, Rotation r2); static final Rotation IDENTITY; }
@Test public void testRevert() { Rotation r = new Rotation(0.001, 0.36, 0.48, 0.8, true); Rotation reverted = r.revert(); checkRotation(r.applyTo(reverted), 1, 0, 0, 0); checkRotation(reverted.applyTo(r), 1, 0, 0, 0); Assert.assertEquals(r.getAngle(), reverted.getAngle(), 1.0e-12); Assert.assertEquals(-1, Vector3D.dotProduct(r.getAxis(), reverted.getAxis()), 1.0e-12); }