grid-7.3: Tools for working with regular grids (graphs, lattices).

Portability portable experimental amy@nualeargais.ie Safe-Inferred

Math.Geometry.Grid.Triangular

Description

A regular arrangement of triangular tiles. The userguide, with illustrations, is available at https://github.com/mhwombat/grid/wiki. Also see `Math.Geometry.Grid` for examples of how to use this class.

Synopsis

Unbounded grid with triangular tiles

An unbounded grid with triangular tiles. The grid and its indexing scheme are illustrated in the user guide, available at https://github.com/mhwombat/grid/wiki.

Triangular grid with triangular tiles

data TriTriGrid Source

A triangular grid with triangular tiles. The grid and its indexing scheme are illustrated in the user guide, available at https://github.com/mhwombat/grid/wiki.

`triTriGrid s` returns a triangular grid with sides of length `s`, using triangular tiles. If `s` is nonnegative, the resulting grid will have `s^2` tiles. Otherwise, the resulting grid will be null and the list of indices will be null.

Parallelogram-shaped grid with triangular tiles

A Parallelogrammatical grid with triangular tiles. The grid and its indexing scheme are illustrated in the user guide, available at https://github.com/mhwombat/grid/wiki.

`paraTriGrid r c` returns a grid in the shape of a parallelogram with `r` rows and `c` columns, using triangular tiles. If `r` and `c` are both nonnegative, the resulting grid will have `2*r*c` tiles. Otherwise, the resulting grid will be null and the list of indices will be null.

Rectangular grid with triangular tiles

A rectangular grid with triangular tiles. The grid and its indexing scheme are illustrated in the user guide, available at https://github.com/mhwombat/grid/wiki.

`rectTriGrid r c` returns a grid in the shape of a rectangle (with jagged edges) that has `r` rows and `c` columns, using triangular tiles. If `r` and `c` are both nonnegative, the resulting grid will have `2*r*c` tiles. Otherwise, the resulting grid will be null and the list of indices will be null.

Toroidal grid with triangular tiles

data TorTriGrid Source

A toroidal grid with triangular tiles. The grid and its indexing scheme are illustrated in the user guide, available at https://github.com/mhwombat/grid/wiki.

`torTriGrid r c` returns a toroidal grid with `r` rows and `c` columns, using triangular tiles. The indexing method is the same as for `ParaTriGrid`. If `r` and `c` are both nonnegative, the resulting grid will have `2*r*c` tiles. Otherwise, the resulting grid will be null and the list of indices will be null.

Cylindrical grids with triangular tiles

A cylindrical grid with triangular tiles, where the cylinder is along the y-axis. The grid and its indexing scheme are illustrated in the user guide, available at https://github.com/mhwombat/grid/wiki.

`yCylTriGrid r c` returns a cylindrical grid with `r` rows and `c` columns, using triangular tiles, where the cylinder is along the y-axis. The indexing method is the same as for `ParaTriGrid`. If `r` and `c` are both nonnegative, the resulting grid will have `2*r*c` tiles. Otherwise, the resulting grid will be null and the list of indices will be null.

A cylindrical grid with triangular tiles, where the cylinder is along the x-axis. The grid and its indexing scheme are illustrated in the user guide, available at https://github.com/mhwombat/grid/wiki.

`xCylTriGrid r c` returns a cylindrical grid with `r` rows and `c` columns, using triangular tiles, where the cylinder is along the y-axis. The indexing method is the same as for `ParaTriGrid`. If `r` and `c` are both nonnegative, the resulting grid will have `2*r*c` tiles. Otherwise, the resulting grid will be null and the list of indices will be null.