Пример #1
0
    def test_mul(self):
        a = Matrix33.identity()
        b = Matrix33.scaling(0.5, 0.5)

        c = a * b

        self.assertEqual((c.m00, c.m01, c.m10, c.m11), (0.5, 0.0, 0.0, 0.5))
Пример #2
0
    def test_scaling(self):
        matrix = Matrix33.scaling(0.5, 0.5)

        vector = matrix.transform(Vector2(1.0, 1.0))

        self.assertEqual((vector.x, vector.y), (0.5, 0.5))