2.1. sinc examples
See chapter4_1.c & chapter4_2.c - try it -> plot, sinc.c
#define PI (4*atan(1))
double sinc( double x)
{
if( fabs(x) < 0.0001)
return 1.0;
else
return sin(PI*x)/(PI*x);
}
Example with local variables:
double sinc( double x)
{
double r, t;
if( fabs(x) < 0.0001)
r = 1.0;
else
{
t = PI*x;
r = sin(t)/(t);
}
return r;
}