Beispiel #1
0
 def test__is_member(self):
     print("Testing is_member method")
     B = Rectangle(4, 2, -4, 2, -4, 0, 4, 0)
     self.assertTrue((B._Rectangle__is_member()))
     B._Quadrilateral__vertices = (TwoDPoint(0,0),TwoDPoint(0,0),TwoDPoint(0,0),TwoDPoint(0,0))
     self.assertFalse((B._Rectangle__is_member()))
     B._Quadrilateral__vertices = (TwoDPoint(0,0),TwoDPoint(-3.5,0),TwoDPoint(-3.5,-7.8),TwoDPoint(0,-7.8))
     self.assertTrue((B._Rectangle__is_member()))
     print("Done testing is_member method successfully")
Beispiel #2
0
from two_d_point import TwoDPoint
from quadrilateral import Quadrilateral
from rectangle import Rectangle
from square import Square

if __name__ == '__main__':
    point1 = TwoDPoint(3, 2)
    print(point1.__str__())
    q1 = Quadrilateral(0, 4, 6, 4, 6, 0, 0, 0)
    print(q1.__str__())
    r1 = Rectangle(0, 4, 6, 4, 6, 0, 0, 0)
    print(r1.__str__())
    s1 = Square(0, 10, 10, 10, 10, 0, 0, 0)
    print(s1.__str__())
    print(r1._Rectangle__is_member())