标签: python python-3.x numerical-methods numerical-analysis
问题是在数值分析中实现重心权重:
这是我的代码:
def barycentric_weights(j,n): weight=1 for k in range(0,n+1): if k != j: weight=weight*(1/(xj-xk)) else: weight=weight*1
我遇到的问题是我不知道如何正确调用xj和xk。我应该称它们为元组吗?