-
-
23 Nov 2015 00:14:31 UTC
- Distribution: Math-HexGrid
- Module version: 0.03
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues
- Testers (524 / 0 / 0)
- Kwalitee
Bus factor: 1- 70.77% Coverage
- License: freebsd
- Activity
24 month- Tools
- Download (5.14KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
NAME
Math::HexGrid - Math::HexGrid - create hex coordinate grids
VERSION
version 0.03
DESCRIPTION
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.METHODS
new_hexagon ($radius)
Constructs a new hexagonally-shaped grid of size
$radius
.new_triangle ($rows)
Constructs a new triangle-shaped grid with
$rows
number of rows.hexgrid
Returns a hashref of all hexes in the grid.
hex ($q, $r)
Returns the hex at location
$q
and$r
.count_sides
Returns a count of all unique sides (edges) in the grid.
SEE ALSO
This code was helped by Amit Patel's articles on hexagonal grids.
AUTHOR
David Farrell <dfarrell@cpan.org>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2015 by David Farrell.
This is free software, licensed under:
The (two-clause) FreeBSD License
Module Install Instructions
To install Math::HexGrid, copy and paste the appropriate command in to your terminal.
cpanm Math::HexGrid
perl -MCPAN -e shell install Math::HexGrid
For more information on module installation, please visit the detailed CPAN module installation guide.