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

📄 sample6_16.cs

📁 用于矩阵的各种运算
💻 CS
字号:
/*
 * 示例程序Sample6_16: Interpolation类的二元三点插值
 */

using System;
using CSharpAlgorithm.Algorithm;

namespace CSharpAlgorithm.Sample
{
	class Class1
	{
		[STAThread]
		static void Main(string[] args)
		{
            int i,j;
            double u,v,w;
            double[] x = new double[6];
            double[] y = new double[5];
            double[] z = new double[30];

            for (i=0;i<=5;i++) 
                x[i]=0.2*i;
            for (j=0;j<=4;j++) 
                y[j]=0.25*j;
            for (i=0;i<=5;i++)
            {
                for (j=0;j<=4;j++)
                    z[i*5+j]=Math.Exp(-(x[i]-y[j]));
            }

            // 插值运算
            u = 0.9; 
            v = 0.8;
            w = Interpolation.GetValueTqip(6, x, 5, y, z, u, v);
            Console.WriteLine("z(" + u + "," + v + ") = " + w);

            u = 0.3; 
            v = 0.9;
            w = Interpolation.GetValueTqip(6, x, 5, y, z, u, v);
            Console.WriteLine("z(" + u + "," + v + ") = " + w);		}
	}
}

⌨️ 快捷键说明

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