Example #1
0
    def contains_point(self, point: Point):
        """
        Tests whether the given point is contained in the circle
        or not.

        :param point: `Point`
        :return: `bool` circle contains point?
        """
        return point.distance_to(self.center) < self.radius
Example #2
0
    def distance_to(self, p: Point):
        """
        Computes the distance between the given point `p` and
        the segment's closest point to `p`.

        :param p: `Point`
        :return: `float` distance to the closest point in segment
        """
        return p.distance_to(self.closest_point_to(p))