Example #1
0
    def get_region(self, points, pt, eps):
        region = []

        for i in range(len(points)):
            distSquared = Point.distance_squared(pt, points[i])
            if distSquared < eps:
                region.append(points[i])
        return region
Example #2
0
    def start_test(self):

        if self.__x1 is not self.pointA.get_x():
            print("Method get_x() failed")
            return False

        if self.__y1 is not self.pointA.get_y():
            print("Method get_y() failed")
            return False

        if self.pointA.set_clusterID(5) is not True:
            print("Method set_clusterID() failed")
            return False

        if self.pointA.get_clusterID() is not 5:
            print("Method get_clusterID() failed")
            return False

        if Point.distance_squared(self.pointA, self.pointB) is not 89:
            print("Method distance_squared() failed")
            return False

        return True