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

📄 interpolation2variable3points.cpp

📁 《Visual C++常用数值算法集》 何光渝编一书的附带源码
💻 CPP
字号:
//Interpolation2Variable3Points.cpp  
//二元三点插值 

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

void main()
{
	int  i, j;
	double u, v, w;

	valarray<double> x(6), y(5);
    
	for(i=0; i<6; i++) x[i] = 0.2 * i;
	for(i=0; i<5; i++) y[i] = 0.25 * i;
	
	matrix<double> z(6,5);

	for(i = 0; i < 6; i ++)
		for(j = 0; j < 5; j ++)
		{
			z(i,j) = exp( -(x[i] - y[j]) );
		}
		
	
	
	cout << "Interpolation2Variable3Points()" << endl << endl;
	
	u = 0.90;
	v = 0.80;
	w = Interpolation2Variable3Points(x, y, z, u, v);
    cout << "x = 0.9    	y = 0.8          z(x,y) = " << w << endl;
		
	u = 0.3;
	v = 0.9;
	w = Interpolation2Variable3Points(x, y, z, u, v);
    cout << "x = 0.3    	y = 0.9          z(x,y) = " << w << endl;	
}


⌨️ 快捷键说明

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