欢迎来到天天文库
浏览记录
ID:57209736
大小:34.00 KB
页数:3页
时间:2020-08-06
《分段三次Hermite插值.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、分段三次Hermite插值1.目的意义:可以得到在插值区间上光滑的分段插值多项式2.数学模型(数学公式):3.算法程序:#include#include#definem4#definen5voidmain(){inti,k;floatx[n+1],y[n+1],yy[n+1],h,z[m];printf("请按行输入一系列的x值:");for(k=0;k2、的y'的值:");for(k=0;k=x[k]&&z[i]<=x[k+1]){h=pow((z[i]-x[k+1])/(x[k]-x[k+1]),2.0)*(1+2*(z[i]-x[k])/(x[k+1]-x[k]))*y[k]+pow((z[i]-x[k])/(x[k+1]-x[3、k]),2.0)*(1+2*(z[i]-x[k+1])/(x[k]-x[k+1]))*y[k+1]+pow((z[i]-x[k+1])/(x[k]-x[k+1]),2.0)*(z[i]-x[k])*yy[k]+pow((z[i]-x[k])/(x[k+1]-x[k]),2.0)*(z[i]-x[k+1])*yy[k+1];printf("h(%f)=%f",z[i],h);}}1.运行结果:
2、的y'的值:");for(k=0;k=x[k]&&z[i]<=x[k+1]){h=pow((z[i]-x[k+1])/(x[k]-x[k+1]),2.0)*(1+2*(z[i]-x[k])/(x[k+1]-x[k]))*y[k]+pow((z[i]-x[k])/(x[k+1]-x[
3、k]),2.0)*(1+2*(z[i]-x[k+1])/(x[k]-x[k+1]))*y[k+1]+pow((z[i]-x[k+1])/(x[k]-x[k+1]),2.0)*(z[i]-x[k])*yy[k]+pow((z[i]-x[k])/(x[k+1]-x[k]),2.0)*(z[i]-x[k+1])*yy[k+1];printf("h(%f)=%f",z[i],h);}}1.运行结果:
此文档下载收益归作者所有