@rickosborne/hexgrid
Version:
Rick Osborne's collection of hexagonal grid-related code.
16 lines • 898 B
TypeScript
import { type PointXY } from "./orientation.js";
/**
* Build a function which can check to see if the given pixel coordinates
* would be contained by the hex described by the corners. To be useful,
* cache this function, and then call it with pixel coordinates translated
* to the original hex's center.
*/
export declare const hexContainsChecker: (corners: PointXY[]) => (xy: PointXY) => boolean;
export declare const hexCornersContainPoint: (corners: PointXY[], xy: PointXY) => boolean;
/**
* Generate a function which can check to see if a given point is inside
* the triangle described by the three points.
*/
export declare const triangleContainsChecker: (triangle: [PointXY, PointXY, PointXY]) => (xy: PointXY) => boolean;
export declare const triangleContainsPoint: (triangle: [PointXY, PointXY, PointXY], point: PointXY) => boolean;
//# sourceMappingURL=hex-contains-point.d.ts.map