Sa函数在全时域积分怎么算,怎么算出得π?
来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:综合作业 时间:2024/07/18 04:59:51
Sa函数在全时域积分怎么算,怎么算出得π?
![Sa函数在全时域积分怎么算,怎么算出得π?](/uploads/image/z/701162-26-2.jpg?t=Sa%E5%87%BD%E6%95%B0%E5%9C%A8%E5%85%A8%E6%97%B6%E5%9F%9F%E7%A7%AF%E5%88%86%E6%80%8E%E4%B9%88%E7%AE%97%2C%E6%80%8E%E4%B9%88%E7%AE%97%E5%87%BA%E5%BE%97%CF%80%3F)
理论解π
计算机只能算出近似值.
#include
#include
#include
double fsimpf(double x)
{
if ( fabs(x) < 1e-12) return 1.0;
return sin(x) /x ;
}
double fsimp(double a,double b,double eps)
{
int n,k;
double h,t1,t2,s1,s2,ep,p,x;
n=1; h=b-a;
t1=h*(fsimpf(a)+fsimpf(b))/2.0;
s1=t1;
ep=eps+1.0;
while (ep>=eps)
{
p=0.0;
for (k=0;k
计算机只能算出近似值.
#include
#include
#include
double fsimpf(double x)
{
if ( fabs(x) < 1e-12) return 1.0;
return sin(x) /x ;
}
double fsimp(double a,double b,double eps)
{
int n,k;
double h,t1,t2,s1,s2,ep,p,x;
n=1; h=b-a;
t1=h*(fsimpf(a)+fsimpf(b))/2.0;
s1=t1;
ep=eps+1.0;
while (ep>=eps)
{
p=0.0;
for (k=0;k