https://github.com/dnmfarrell/math-hexgrid
https://github.com/dnmfarrell/math-hexgrid
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dnmfarrell/math-hexgrid
- Owner: dnmfarrell
- License: other
- Created: 2015-10-21T21:48:56.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-08-27T15:18:51.000Z (almost 3 years ago)
- Last Synced: 2025-03-06T05:43:50.955Z (over 1 year ago)
- Language: Perl
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.pod
- License: LICENSE
Awesome Lists containing this project
README
=pod
=encoding UTF-8
=head1 NAME
Math::HexGrid - Math::HexGrid - create hex coordinate grids
=head1 VERSION
version 0.04
=head1 DESCRIPTION
This module is for creating hex grids of L objects. For
now it only supports hexagonally-shaped grids. It supports both cube and
axial (trapezoidal) coordinate systems.
=head1 METHODS
=head2 new_hexagon ($radius)
Constructs a new hexagonally-shaped grid of size C<$radius>.
=head2 new_triangle ($rows)
Constructs a new triangle-shaped grid with C<$rows> number of rows.
=head2 hexgrid
Returns a hashref of all hexes in the grid.
=head2 hex ($q, $r)
Returns the hex at location C<$q> and C<$r>.
=head2 count_sides
Returns a count of all unique sides (edges) in the grid.
=head1 SEE ALSO
This code was helped by Amit Patel's L on hexagonal grids.
=head1 AUTHOR
David Farrell
=head1 COPYRIGHT AND LICENSE
This software is Copyright (c) 2015 by David Farrell.
This is free software, licensed under:
The (two-clause) FreeBSD License
=cut