コード例 #1
0
def find_intersect_ray_circle(board1_xy, board2_xy, board1_dist, board2_dist):
    board1_xy = Point(board1_xy[0], board1_xy[1])
    board2_xy = Point(board2_xy[0], board2_xy[1])
    circle1 = Circle(board1_xy, board1_dist)
    circle2 = Circle(board2_xy, board2_dist)
    intersect = circle1.intersect(circle2)
    intersect = np.array(intersect.args, dtype=float)
    return intersect
コード例 #2
0
def find_intersect_circle_circle(circle_center1, r_1, circle_center2, r_2):
    point1 = Point(circle_center1)
    point2 = Point(circle_center2)
    circle1 = Circle(point1, sympify(str(r_1), rational=True))
    circle2 = Circle(point2, sympify(str(r_2), rational=True))
    intersect = circle2.intersect(circle1)
    if len(intersect) == 0:
        return np.nan * np.eye(2)
    else:
        intersect = np.array([intersect.args[0], intersect.args[1]],
                             dtype=float)
        return intersect