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

Copyright (c) Amy de Buitléir 2012-2015 BSD-style amy@nualeargais.ie experimental portable Safe-Inferred Haskell98

Math.Geometry.Grid.Hexagonal

Description

A regular arrangement of hexagonal 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 hexagonal tiles

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

Constructors

 UnboundedHexGrid

Instances

 Eq UnboundedHexGrid Show UnboundedHexGrid Generic UnboundedHexGrid Grid UnboundedHexGrid type Rep UnboundedHexGrid type Index UnboundedHexGrid = (Int, Int) type Direction UnboundedHexGrid = HexDirection

# Hexagonal grid with hexagonal tiles

data HexHexGrid Source

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

Instances

 Eq HexHexGrid Show HexHexGrid Generic HexHexGrid BoundedGrid HexHexGrid FiniteGrid HexHexGrid Grid HexHexGrid type Rep HexHexGrid type Size HexHexGrid = Int type Index HexHexGrid = (Int, Int) type Direction HexHexGrid = HexDirection

`hexHexGrid s` returns a grid of hexagonal shape, with sides of length `s`, using hexagonal tiles. If `s` is nonnegative, the resulting grid will have `3*s*(s-1) + 1` tiles. Otherwise, the resulting grid will be null and the list of indices will be null.

# Parallelogram-shaped grid with hexagonal tiles

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

Instances

 Eq ParaHexGrid Show ParaHexGrid Generic ParaHexGrid BoundedGrid ParaHexGrid FiniteGrid ParaHexGrid Grid ParaHexGrid type Rep ParaHexGrid type Size ParaHexGrid = (Int, Int) type Index ParaHexGrid = (Int, Int) type Direction ParaHexGrid = HexDirection

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