1 #encoding=utf-8 2 from numpy import * 3 import numpy as np 4 5 import matplotlib.pyplot as plt 6 plt.close() 7 fig=plt.figure() 8 plt.grid(True) 9 plt.xlabel("X") 10 plt.ylabel("Y") 11 plt.title(u"二次样条", fontproperties='SimHei') 12 #二次样条 13 #设已知n+1个点 设方程式为yi = ai*x**2+bi*x+ci,则需要求解3n个参数,则需要3n个条件。 14 # 由曲线过点得2n 个条件 ,由内点处一次求导相等得n-1个条件 ,令第一个节点处二阶导为0 得一个条件 a1 = 0 15<