弧交点算法

问题描述 投票:0回答:1

设置有3个点的2个圆弧:2个边界和圆弧中的点(以了解点之间的圆的哪一侧是圆弧)所以我需要在python上写弧形交集代码

def get_arc_sortbased(data, break_angle):
  points = data.loc[:,'x':]
  angles = points.apply(convert_to_angle,axis=1)
  points['angles'] = angles
  modes = get_mode_angle(points.loc[:,'angles'],radius=2).tolist()
  print('MODES')
  print(modes)
  points = points.sort_values(by=['angles'])
  point_lst = points['angles'].tolist()
  arcs = []
  for mode in modes:
    cent = point_lst[bs.bisect_right(point_lst, mode)]
    end_1 = find_arc_end(point_lst, mode, break_angle)
    end_2 = find_arc_end(point_lst, mode, break_angle, direction='clockwise', endPoint=end_1)
    arcs.append([end_1, cent, end_2])
  return arcs
python intersection
1个回答
0
投票
这里是使用Python的符号数学库SymPy的解决方案。构造前两个圆,并计算它们的交点。相交可以是一个完整的圆(两个圆相同时),两个点,一个点(切向圆)或空白。
© www.soinside.com 2019 - 2024. All rights reserved.