示例#1
0
文件: entity.py 项目: jdddog/hri
    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)
示例#2
0
文件: entity.py 项目: jdddog/hri
    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)
示例#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))
示例#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))