?? 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 + -