Package-level declarations
The package contains utility functions and classes that aid in performing various mathematical operations specific to the program's focus on coordinates and shapes in a hexagonal grid:
Bresenham's Line Algorithm Functions: These functions, named
bresenhamsLine
, implement the Bresenham's line generation algorithm. They can produce a symmetric line of coordinates between two points on a hexagonal grid. It's slightly modified to be symmetric, so that the line is the same when drawn from either point.Line Drawing Functions: The package includes functions like
T.lineTo
that use the Bresenham's line algorithm to draw lines between two given coordinates on a hexagonal grid.Distance Calculation Functions: Functions such as
T.distanceTo
and the standalonedistance
function are used to calculate the distance between two given coordinates on a hexagonal grid.Hexagonal Shape Functions: The package also contains functions like
T.circle
andT.ring
to generate a circular or ring-like arrangement of coordinates around a given point on a hexagonal grid.
Please refer to individual function documentation for more detailed explanations and examples of usage.
Types
Functions
Implements Bresenham's line generation algorithm to plot a line between two points on a hexagonal grid. Calls the provided process function for each point along the line. This function generates a symmetric line, meaning swapping the start and end points won't affect the result.
Uses Bresenham's line generation algorithm to create a path from this coordinate to another.
Generates a line of coordinates from this coordinate to another.