首页 > 其他 > 详细

平滑曲线

时间:2019-01-04 00:12:04      阅读:168      评论:0      收藏:0      [点我收藏+]
def smooth_curve(points, factor = 0.9):
    smoothed_points = []
    for point in points:
        if smoothed_points:
            previous = smoothed_points[-1]
            smoothed_points.append(previous * factor + point * (1 - factor))
        else:
            smoothed_points.append(point)
    return smoothed_points

 

平滑曲线

原文:https://www.cnblogs.com/wbloger/p/10217542.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!