使用args的线串中的点之间的距离

时间:2017-07-12 11:42:30

标签: python line distance points args

在代码中,波纹管点需要根据x的值排列,然后不像我下面那样手动计算距离,而是自动计算未知点数

class line(Point):

    def __init__(self, *args):
        self.n = [Point(p[0], p[1]) for p in args]
        # here the points need be arranged
        # according to the values of x 
        # and then calculate the distance not manually
        # as I did below but automatically 
        # with an unknown number of points 
        print(self.n)

0 个答案:

没有答案