An open API service indexing awesome lists of open source software.

https://github.com/nlitsme/pointenumerator

Several algorithms for enumerating points in an unbounded plane
https://github.com/nlitsme/pointenumerator

algorithm plane-enumerator

Last synced: 3 months ago
JSON representation

Several algorithms for enumerating points in an unbounded plane

Awesome Lists containing this project

README

        

# pointenumerator
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.


TODO
====

* add _block_ for enumerating entire plane in block shape.
* add half-plane enumerator
* add volume enumerators:
* octant in tetrahedron shape
* space in cube shape

AUTHOR
======

Willem Hengeveld