⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 interpolation1variable3pointsisometry.cpp

📁 计算机常用数值计算算法与程序 C++版 各章代码
💻 CPP
字号:
//Interpolation1Variable3PointsIsometry.cpp	
//一元三点等距插值

#include <iostream.h>		/输入输出流头文件
#include "Interpolation.h"	//插值头文件

void main()
{
	double x0(0.1), h(0.1), t, s;
	double y[10] = 
	{
		0.904837, 0.818731, 0.740818, 0.670320, 0.606531,
	    0.548812, 0.496585, 0.449329, 0.406570, 0.367879
	};
	valarray<double> yy(y,10);
	   
	cout << " Interpolation1Variable3PointsIsometry()" << endl;
	
	t = 0.23;
	cout << endl << " t = " << t;
	s = Interpolation1Variable3PointsIsometry(x0,h,yy,t);
    cout << "\t s1 = " << s << endl;
    
	t = 0.63;
	cout<<" t = " << t;
	s = Interpolation1Variable3PointsIsometry(x0,h,yy,t);
    cout << "\t s2 = " << s << endl;
    
	t = 0.95;
	cout<<" t = " << t;
	s = Interpolation1Variable3PointsIsometry(x0,h,yy,t);
    cout << "\t s3 = " << s << endl;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -