gtm_hxg

Produces a 2D grid with points arranged in a hexagonal lattice.

The grid is centered on the origin and scaled so the dimension (X or Y) with largest number of points ranges from -1 to 1.

Synopsis

grid = gtm_hxg(xDim, yDim)

Arguments

xDim, yDim - number of points along the X and Y dimensions, respectively; must be >=2.

Return

grid - a (xDim*yDim)-by-2 matrix of grid points with the first point being the top-left corner and subsequent points following columnwise.

See also

gtm_rctg


The GTM Toolbox: Contents