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
- Host: GitHub
- URL: https://github.com/nlitsme/pointenumerator
- Owner: nlitsme
- License: mit
- Created: 2016-08-24T13:10:13.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-25T15:35:43.000Z (almost 9 years ago)
- Last Synced: 2025-02-01T12:46:42.069Z (5 months ago)
- Topics: algorithm, plane-enumerator
- Language: C++
- Size: 11.7 KB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pointenumerator
Several algorithms for enumerating points in an unbounded planeThis 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 shapeAUTHOR
======Willem Hengeveld