?? sample6_11.cs
字號(hào):
/*
* 示例程序Sample6_11: Interpolation類的光滑不等距插值
*/
using System;
using CSharpAlgorithm.Algorithm;
namespace CSharpAlgorithm.Sample
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
// 數(shù)據(jù)
int n = 11;
double[] x = {-1.0,-0.95,-0.75,-0.55,-0.3,0.0,0.2,0.45,0.6,0.8,1.0};
double[] y = {0.0384615,0.0424403,0.06639,0.116788,0.307692,1.0,0.5,0.164948,0.1,0.0588236,0.0384615};
double[] t = {-0.85,0.15};
// 插值運(yùn)算
for (int i=0; i<t.Length; ++i)
{
double[] coef = new double[5];
double yt = Interpolation.GetValueAkima(n, x, y, t[i], coef, -1);
Console.WriteLine("f(" + t[i] + ") = " + yt);
for (int j=0; j<coef.Length; ++j)
Console.WriteLine("s" + j + " = " + coef[j]);
}
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -