len(curve1), len(curve2) free_space = np.zeros((m, n)) for i in range(m): for j in range(n): if i == 0 and j == 0: free_space[i, j] = euclidean_distance(curve1[i], curve2[j]) <= epsilon elif i == 0: free_space[i, j] = point_to_segment_distance(curve1[i], curve2[j-1], curve2[j]) <= epsilon elif j == 0: free_space[i, j] = point_to_segment_distance(curve2[j], curve1[i-1], curve1[i]) <= epsilon else: dist1 = point_to_segment_distance(curve1[i], curve2[j-1], curve2[j]) dist2 = point_to_segment_distance(curve2[j], curve1[i-1], curve1[i]) free_space[i, j] = min(dist1, dist2) <= epsilon return free_space アルゴリズムの詳細 線分間の距離が ε以下であ るものを絞り込める