def testMatrixMapping(self): m = QMatrix(1.0, 2.0, 1.0, 3.0, 100.0, 200.0) res = m.map(5, 5) self.assertAlmostEqual(res[0], 5 * 1.0 + 5 * 1.0 + 100.0) self.assertAlmostEqual(res[1], 5 * 2.0 + 5 * 3.0 + 200.0) res = m.map(5.0, 5.0) self.assertAlmostEqual(res[0], 5.0 * 1.0 + 5.0 * 1.0 + 100.0) self.assertAlmostEqual(res[1], 5.0 * 2.0 + 5.0 * 3.0 + 200.0)
def testMatrix(self): matrix = QMatrix(11, 12, 21, 22, 100, 200) point = QPoint(3, 3) self.assertEqual(matrix.map(point), qpointTimesQMatrix(point, matrix))