34 #define M_PI 3.1415926535897932384626433832795
73 float x, y, exponential, sincos;
88 for (
int i = 0; i <
mRadius; i++ )
93 for (
int j = 0; j <
mRadius; j++ )
96 y = (float)( i -
mXYO );
97 x = (float)( j -
mXYO );
100 exponential = exp( - ( x*x + y*y ) /
mSigma );
104 mReal[i][j] = exponential * sin( sincos );
105 mImaginary[i][j] = exponential * ( cos( sincos ) - exp( (
float)((-1.0*
M_PI*
M_PI)/2.0f) ) );
118 strcpy( filename, file );
119 sprintf( suffix,
"gf_i_%d_%d.pgm", angle, freq );
120 strcat( filename, suffix );
122 strcpy( filename, file );
123 sprintf( suffix,
"gf_r_%d_%d.pgm", angle, freq );
124 strcat( filename, suffix );
void Save(char *file, int angle, int freq)
void Initialize(int radius, float a, float f, float s, float p=0)
void WriteScaled(char *filename, float **output, int height, int width)