PitchKit
API Reference@pitchkit/coreFunctions

hexCorners()

function hexCorners(
   centerX, 
   centerY, 
   radius, 
   dimensions?
): readonly [number, number][];

Defined in: packages/core/src/hexbin/bins.ts:37

The six vertices of a pointy-top hexagon, in provider coordinates, starting at the top vertex and going clockwise. Shared by the painter and the tests so "what shape is a hex bin" has one definition.

radius is in display units. With dimensions given, each corner's offset is converted back to provider units per axis, so on a percentage grid (where one x unit and one y unit cover different amounts of grass) the hexagon is regular on screen rather than in grid units (#99). Without it the axes are taken to share a unit.

Parameters

ParameterType
centerXnumber
centerYnumber
radiusnumber
dimensions?PitchDimensions

Returns

readonly [number, number][]

On this page