I'm trying to devise an algorithm for enumerating all points on a 2D grid in order of their Euclidean distance to a given target point. I know I could just get a bunch of them that are close to the target and then sort them, but that's not what I want. I want something that will output every point, out to infinity, in order of their distance to the target.
At the bare minimum, I need something that works if the target point is also a grid point. But ideally, I want something that works for any target, even non-grid points. Ideally ideally, I want something that works for grids of an uneven x-y scale.
Any ideas on where to start with this?