line_geometry.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:orange-infrared 作者: markotoplak 项目源码 文件源码
def distance_curves(x, ys, q1):
    """
    Distances to the curves.

    :param x: x values of curves (they have to be sorted).
    :param ys: y values of multiple curves sharing x values.
    :param q1: a point to measure distance to.
    :return:
    """

    # convert curves into a series of startpoints and endpoints
    xp = rolling_window(x, 2)
    ysp = rolling_window(ys, 2)

    r = np.nanmin(distance_line_segment(xp[:, 0], ysp[:, :, 0],
                              xp[:, 1], ysp[:, :, 1],
                              q1[0], q1[1]), axis=1)

    return r
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号