Initial snark14m import
[snark14.git] / src / snark / sinc.cpp
1 /*
2  ***********************************************************
3  $SNARK_Header: S N A R K  1 4 - A PICTURE RECONSTRUCTION PROGRAM $
4  $HeadURL: svn://dig.cs.gc.cuny.edu/snark/trunk/src/snark/sinc.cpp $
5  $LastChangedRevision: 97 $
6  $Date: 2014-07-02 20:07:41 -0400 (Wed, 02 Jul 2014) $
7  $Author: agulati $
8  ***********************************************************
9
10  SINC(X)=SIN(PI*X)/(PI*X)
11  */
12
13 #include <cstdio>
14 #include <cmath>
15
16 #include "blkdta.h"
17 #include "consts.h"
18
19 #include "sinc.h"
20
21 REAL sinc(REAL x)
22 {
23         if (fabs(x) < Consts.zero)
24         {
25                 return 1.0;
26         }
27
28         return (REAL) sin(Consts.pi * x) / (Consts.pi * x);
29 }