我试图从 scipy interpolate Cubic Spline 与点 (0,0),(1,1), (2,0) 获取三次样条多边形的系数。我得到的系数与网站上的值不同:https://tools.timodenk.com/cubic-spline-interpolation 插入相同的点。 我想知道为什么。 谢谢
from scipy.interpolate import CubicSpline
x=[0,1,2]
y=[0,1,0]
myCS=CubicSpline(x,y,axis=0,bc_type=((2,0),(2,0)))
print(myCS.c)
预期:-0.5, 0, 1,5, 0 0.5、-3、4.5、-1
系数的确切定义在 PPoly 文档字符串中列出:https://docs.scipy.org/doc/scipy/reference/ generated/scipy.interpolate.PPoly.html