Exemplo n.º 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))
Exemplo n.º 2
0
    def test_identity(self):
        matrix = Matrix33.identity()

        values = [matrix.m00, matrix.m01,
                  matrix.m10, matrix.m11]

        self.assertEqual(values, [1.0, 0.0,
                                  0.0, 1.0])
Exemplo n.º 3
0
    def test_transform(self):
        matrix = Matrix33.identity()

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

        self.assertEqual((vector.x, vector.y), (1.0, 2.0))