Skip to content

nlitsme/pointenumerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

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 itsme@xs4all.nl

About

Several algorithms for enumerating points in an unbounded plane

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages