📄 fourierseriesapproach.cpp
字号:
//FourierSeriesApproach.cpp 傅里叶级数逼近
#include <iostream> //模板类输入输出流标准头文件
#include <Transform.h> //数学变换头文件
using namespace std; //名字空间
void main(void)
{
valarray<long double> a(51);
valarray<long double> b(51);
valarray<long double> f(101);
long double h = 6.283185306 / 101.0;
for(int i=0; i<101; i++)
{
long double ld = (i + 0.5) * h;
f[i] = ld * ld;
}
cout.setf(ios::fixed); //输出数据为定点法
cout.precision(8); //精度8位
FourierSeriesApproach(f, a, b);
cout << endl;
for (i=0; i<51; i++)
cout << "a(" << i << ") = " << a[i]
<< "\t b(" << i << ") = " << b[i] << endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -