@Test public void testGetTranslation() throws Exception { Random random = new Random(2345L); AffineTransform transform = EuclidCoreRandomTools.nextAffineTransform(random); Vector3D translation = new Vector3D(); transform.getTranslation(translation); for (int row = 0; row < 3; row++) assertTrue(translation.getElement(row) == transform.getElement(row, 3)); EuclidCoreTestTools.assertTuple3DEquals(translation, transform.getTranslationVector(), EPS); translation.set(transform.getTranslationX(), transform.getTranslationY(), transform.getTranslationZ()); EuclidCoreTestTools.assertTuple3DEquals(translation, transform.getTranslationVector(), EPS); }
public Vector3D getTranslation() { Vector3D translation = new Vector3D(); getTransform().getTranslation(translation); return translation; }
RotationScaleMatrix expectedRotationScale = new RotationScaleMatrix(); Vector3D expectedTranslation = new Vector3D(); transform.getTranslation(expectedTranslation);
Vector3D actualTranslation = new Vector3D(); transform.getRotationScale(expectedMatrix); transform.getTranslation(expectedTranslation); transform.get(actualMatrix, actualTranslation); assertEquals(expectedMatrix, actualMatrix); Vector3D actualTranslation = new Vector3D(); transform.getRotationScale(expectedMatrix); transform.getTranslation(expectedTranslation); transform.get(actualMatrix, actualTranslation); assertEquals(expectedMatrix, actualMatrix);
transform.getTranslation(translation); transform.getScale(scale);
RotationScaleMatrix expectedRotationScale = new RotationScaleMatrix(); Vector3D expectedTranslation = new Vector3D(); transform.getTranslation(expectedTranslation);
t1.getTranslation(translation); translation.setElement(row, translation.getElement(row) + 0.999 * epsilon); t2.setTranslation(translation); t1.getTranslation(translation); translation.setElement(row, translation.getElement(row) + 1.001 * epsilon); t2.setTranslation(translation); t1.getTranslation(translation); translation.setElement(row, translation.getElement(row) - 0.999 * epsilon); t2.setTranslation(translation); t1.getTranslation(translation); translation.setElement(row, translation.getElement(row) - 1.001 * epsilon); t2.setTranslation(translation);