Given a two-dimensional coordinate system how can I find all points with integer coordinates in a radius from a given point? I want the points as x-coordinate and y-coordina
One way is an outer loop on x from -R to +R and an inner loop on y according to the y values of the circle at that x value (from -sqrt(r^2 - x^2) to sqrt(r^2 - x^2) if the center is at 0,0), if the center is at X,Y - simply add X or Y to all loop ranges in the same manner as you did in your example