?? sample6_2.cs
字號(hào):
/*
* 示例程序Sample6_2: Interpolation類的一元全區(qū)間等距插值
*/
using System;
using CSharpAlgorithm.Algorithm;
namespace CSharpAlgorithm.Sample
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
// 數(shù)據(jù)
int n = 10;
double x0 = 0.10;
double xstep = 0.10;
double[] y = {0.904837,0.860708,0.778801,0.670320,0.606531,0.565525,0.496585,0.427415,0.394554,0.367879};
double[] t = {0.25, 0.63, 0.95};
// 插值運(yùn)算
for (int i=0; i<t.Length; ++i)
{
double yt = Interpolation.GetValueLagrange(n, x0, xstep, y, t[i]);
Console.WriteLine("f(" + t[i] + ") = " + yt);
}
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -