Beispiel #1
0
    def is_left_of(self, other_entity):
        if not isinstance(other_entity, AbstractEntity):
            raise TypeError("is_behind() parameter other_entity={0} is not a subclass of AbstractEntity".format(other_entity))

        origin = Point()
        other = self.translation_to(other_entity)
        return GeomMath.is_left_of(other, origin)
Beispiel #2
0
    def is_left_of(self, other_entity):
        if not isinstance(other_entity, AbstractEntity):
            raise TypeError(
                "is_behind() parameter other_entity={0} is not a subclass of AbstractEntity"
                .format(other_entity))

        origin = Point()
        other = self.translation_to(other_entity)
        return GeomMath.is_left_of(other, origin)
Beispiel #3
0
 def test_is_left_of(self):
     self.assertTrue(GeomMath.is_left_of(self.left, self.center))
     self.assertFalse(GeomMath.is_left_of(self.right, self.center))
Beispiel #4
0
 def test_is_left_of(self):
     self.assertTrue(GeomMath.is_left_of(self.left, self.center))
     self.assertFalse(GeomMath.is_left_of(self.right, self.center))