计算两点之间的插值点,简单的线性插值

"""计算两点之间的插值点,简单的线性插值"""

import math

def insert_point(a,b,step):
    """a:起点坐标二元组,b:终点坐标二元组,step:步长"""
    points = []
    x1,y1 = a       # 起点
    x2,y2 = b       # 终点
    dy = y2 - y1
    dx = x2 - x1
    angle = math.atan2(dy,dx)
    distance = int(math.sqrt(dx*dx+dy*dy))

You must log in to read the rest of this article. Please log in or register as a user.