Ejemplo n.º 1
0
    def test_pow(self):
        t = TransformationCollection([translation(1, 2)] * 10)

        assert t**0 == TransformationCollection([np.eye(3)] * 10)
        assert t**1 == t
        assert t**2 == TransformationCollection([translation(2, 4)] * 10)
        assert t**3 == TransformationCollection([translation(3, 6)] * 10)
        assert t**(-2) == TransformationCollection([translation(-2, -4)] * 10)
Ejemplo n.º 2
0
 def test_inverse(self):
     E = TransformationCollection([np.eye(4)] * 10)
     M = TransformationCollection([rotation(np.pi, axis=Point(0, 1, 0))] *
                                  10)
     assert M.inverse() * M == E