Similarly to how cantor pairing function works by pairing two numbers >=0 to 1 unique number >=0, and where the ordering goes zig zag like dovetailing, is there a way to map numbers including negative ones to unique numbers but for a spiral pattern?
In this image, the center is centered on (0,0). Given a square of odd length, i.e. 1, 3, 5, 7..., does there exist a function that can map the coordinates to the ones indicated in red font? Like
(0,0) -> 0,
Does anyone know?