Resource icon

Spiral Grid Coordinates 1.0

Mergu

Helper
Staff member
Helper
Dec 14, 2018
9
3
3
Mergu submitted a new resource:

Spiral Grid Coordinates - Takes an id value and outputs coordinates that spiral around in a grid pattern

I needed a way to turn an id (starting at 1 and going into the thousands, tens of thousands, so on) into coordinates that spiral around a point in a grid. I didn't want to do it with loops because as more ids get consumed, the run time to find the next coordinate would continue to increase and increase. So after scouring the internet I've found a formula to do it in constant time, no loops, and thought I'd share here after converting it into a proc. It doesn't matter if the id is 1 or...

Read more about this resource...