is there a clean way to convert a 2d vector ( from relative position between two objects ) to 1d index using blender drivers? it should be extendable to add more items later . it is useful to control a grease pencil frame with 'Time Offset' fixed modifier.
To translate global position into a position in a grid:
Basically, if the grid can have numeric identities in reading order...
This relies on the grid being cartessian, and made of one meter cells. I placed the corner of the top left cell at the origin. Conversion to polar coordinates is probably possible, but more complicated (need to know I'm on the right track first so no wasted work, you know ;-)