Example #1
0
    def test_area(self):
        # a triangle has three points, and 4 color bands (RGBA)
        c = (0, 0, 0)
        t = Triangle([0, 0, 10, 0, 10, 10], c, 255)
        self.assertEqual(t.get_area(), 50)

        t = Triangle([10, 10, 0, 0, 10, 0], c, 255)
        self.assertEqual(t.get_area(), 50)

        t = Triangle([0, 0, 5, 0, 5, 10], c, 255)
        self.assertEqual(t.get_area(), 25)
Example #2
0
    def test_area(self):
        # a triangle has three points, and 4 color bands (RGBA)
        c = (0, 0, 0)
        t = Triangle([0, 0, 10, 0, 10, 10], c, 255)
        self.assertEqual(t.get_area(), 50)

        t = Triangle([10, 10, 0, 0, 10, 0], c, 255)
        self.assertEqual(t.get_area(), 50)

        t = Triangle([0, 0, 5, 0, 5, 10], c, 255)
        self.assertEqual(t.get_area(), 25)