Several algorithms for enumerating points in an unbounded plane
This is not a library or a tool. I am not even providing a Makefile
or build instructions.
Four different ways of mapping a single integer to a point in a plane.
- zigzag ( only block 0 <= x,y <= w )
- triangle shape ( includes only the x,y >=0 quadrant )
- diamond shape ( full plane )
- spiral ( full plane )
zigzag, and spiral always make steps of distance 1
.
diamond and triangle make steps of either 1
, or sqrt(2)
Each enumeration algorithm implements two functions: n2pt
and pt2n
, the first converts an integer to a point, the second converts a point to an integer.
- add block for enumerating entire plane in block shape.
- add half-plane enumerator
- add volume enumerators:
- octant in tetrahedron shape
- space in cube shape
Willem Hengeveld itsme@xs4all.nl