根据起始点以及目标点,可以得到若干包含目标点的插值曲线,如下图。
# python代码
x = np.arange(-0.1, 0.2, 0.02)
# y = 2(y_start - y_mid) / (x_mid - x_start)^3 * (x - x_start)^3 + 3(y_mid - y_start) / (x_mid - x_start)^2 * (x - x_start)^2 + y_start
# x_start=-0.1, y_start=0.8, x_mid=0.1, y_mid=0.9
y = -25 * (x + 0.1)**3 + 7.5 * (x + 0.1)**2 + 0.8
y2 = 25 * (x + 0.1)**3 - 7.5 * (x + 0.1)**2 + 0.8
# x_start=-0.1, y_start=0.8, x_mid=0.1, y_mid=1.0
y5 = -50 * (x + 0.1)**3 + 15 * (x + 0.1)**2 + 0.8
y6 = 50 * (x + 0.1)**3 - 15 * (x + 0.1)**2 + 0.8
# x_start=-0.1, y_start=0.8, x_mid=0.1, y_mid=1.1
y7 = -75 * (x + 0.1)**3 + 22.5 * (x + 0.1)**2 + 0.8
y8 = 75 * (x + 0.1)**3 - 22.5 * (x + 0.1)**2 + 0.8
plt.plot(x, y, 'b-.')
plt.plot(x, y2, 'b-.')
plt.plot(x, y5, 'b-.')
plt.plot(x, y6, 'b-.')
plt.plot(x, y7, 'b-.')
plt.plot(x, y8, 'b-.')
plt.show()



