Math::HexGrid - Math::HexGrid - create hex coordinate grids
version 0.03
This module is for creating hex grids of Math::HexGrid::Grid objects. For now it only supports hexagonally-shaped grids. It supports both cube and axial (trapezoidal) coordinate systems.
Math::HexGrid::Grid
Constructs a new hexagonally-shaped grid of size $radius.
$radius
Constructs a new triangle-shaped grid with $rows number of rows.
$rows
Returns a hashref of all hexes in the grid.
Returns the hex at location $q and $r.
$q
$r
Returns a count of all unique sides (edges) in the grid.
This code was helped by Amit Patel's articles on hexagonal grids.
David Farrell <dfarrell@cpan.org>
This software is Copyright (c) 2015 by David Farrell.
This is free software, licensed under:
The (two-clause) FreeBSD License
To install Math::HexGrid, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::HexGrid
CPAN shell
perl -MCPAN -e shell install Math::HexGrid
For more information on module installation, please visit the detailed CPAN module installation guide.