interpolationfractionnotisometry.cpp

来自「本程序提供多种实用插值函数:一元全区间不等距插值、一元全区间等距插值、一元三点不」· C++ 代码 · 共 40 行

CPP
40
字号
//InterpolationFractionNotIsometry.cpp  
//连分式不等距插值
 
#include <iostream.h>		//输入输出流头文件
#include "Interpolation.h"	//插值头文件

void main()
{
	double t, s;

	double x[10] = 
	{
		-1.0, -0.8, -0.65, -0.4, -0.3, 
		 0.0,  0.2,  0.45,  0.8,  1.0
	};

    double y[10] = 
	{
		0.0384615, 0.0588236, 0.0864865, 0.2,       0.307692,
		1.0,       0.5,       0.164948,  0.0588236, 0.0384615
	};

    valarray<double> yy(y,10);
	valarray<double> xx(x,10);
   
   	cout << " InterpolationFractionNotIsometry() " <<endl;
	
	t = -0.85;
	cout << endl << " t = " << t;
	s = InterpolationFractionNotIsometry(xx,yy,t);
    cout << "\t s2 = " << s << endl;
    
	t = 0.25;
	cout<<" t = " << t;
	s = InterpolationFractionNotIsometry(xx,yy,t);
    cout << "\t s3 = " << s << endl;    
}


⌨️ 快捷键说明

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