Ejemplo n.º 1
0
Archivo: entity.py Proyecto: jdddog/hri
    def distance_to(self, other_entity):
        if not isinstance(other_entity, AbstractEntity):
            raise TypeError("distance_to() parameter other_entity={0} is not a subclass of AbstractEntity".format(other_entity))

        origin = Point()
        other = self.translation_to(other_entity)
        return GeomMath.distance_between(origin, other)
Ejemplo n.º 2
0
Archivo: entity.py Proyecto: jdddog/hri
    def distance_to(self, other_entity):
        if not isinstance(other_entity, AbstractEntity):
            raise TypeError(
                "distance_to() parameter other_entity={0} is not a subclass of AbstractEntity"
                .format(other_entity))

        origin = Point()
        other = self.translation_to(other_entity)
        return GeomMath.distance_between(origin, other)
Ejemplo n.º 3
0
 def test_distance_to(self):
     distance = GeomMath.distance_between(self.center, self.infront)
     self.assertEqual(distance, math.sqrt(3))
Ejemplo n.º 4
0
 def test_distance_to(self):
     distance = GeomMath.distance_between(self.center, self.infront)
     self.assertEqual(distance, math.sqrt(3))