public static double GetDistance(float p1X, float p1Z, float p2X, float p2Z)
double xDelta = p1X - p2X;
double yDelta = p1Z - p2Z;
return Math.Sqrt(Math.Pow(xDelta, 2) + Math.Pow(yDelta, 2));
public static void Main()
float radius = window / 2.0f;
float cX = window / 2.0f;
int numStreamedCells = 0;
for(int x = 0; x < window; ++x)
for(int z = 0; z < window; ++z)
if (GetDistance((float)cX, (float)cZ, (float)x + 0.5f, (float)z + 0.5f) < radius)
float percent = (float)numStreamedCells / (float)numCells;
Console.WriteLine("Num Cells = " + numCells.ToString());
Console.WriteLine("Num Visible = " + numStreamedCells.ToString());
Console.WriteLine("Percent = " + percent.ToString());