📄 sample6_1.cs
字号:
/*
* 示例程序Sample6_1: Interpolation类的一元全区间不等距插值
*/
using System;
using CSharpAlgorithm.Algorithm;
namespace CSharpAlgorithm.Sample
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
// 数据
int n = 10;
double[] x = {0.10,0.15,0.25,0.40,0.50,0.57,0.70,0.85,0.93,1.00};
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.63;
// 插值运算
double yt = Interpolation.GetValueLagrange(n, x, y, t);
Console.WriteLine("f(" + t + ") = " + yt);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -