A collection of simple generic algorithms and data structures for mathematical functions and geometric shapes