I have written the following code to derive find out the average intensities at a given radius from the center of an array.

void temp_match_img::makevec(){
int temp;
for(int i=-radius; i<=radius; i++){
for(int j=-radius; j<=radius; j++){
temp=(int)sqrt(float(i*i+j*j)); //distance of the point from the local center
if(temp<=radius){
rpvec[temp]+=tmimg[i+row][j+col]/temp; //The average intensity at //radius=temp
}
}
}
}


Can anyone tell me what is approximately the number of pixels in a circle say "n" pixels in radius?
My current approximation is that it is some constant into "temp" - which is the distance of any point from the center of the array.

N.B. The array has odd dimension, e.g. 21X21 or 105X105

Also please let me know how to publish codes. People on this forum publish codes in good looking format, and I do the same in the above ugly format.