public static IEnumerable <int2> FindTilesInCircle(this World world, int2 a, int r) { var min = world.ClampToWorld(a - new int2(r, r)); var max = world.ClampToWorld(a + new int2(r, r)); for (var j = min.Y; j <= max.Y; j++) { for (var i = min.X; i <= max.X; i++) { if (r * r >= (new int2(i, j) - a).LengthSquared) { yield return(new int2(i, j)); } } } }