来自 Scipy Interpolate 的三次样条系数

问题描述 投票:0回答:1

我试图从 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

python scipy spline cubic
1个回答
0
投票

系数的确切定义在 PPoly 文档字符串中列出:https://docs.scipy.org/doc/scipy/reference/ generated/scipy.interpolate.PPoly.html

© www.soinside.com 2019 - 2024. All rights reserved.