HEX_GRID
Routines for a Hexagonal Grid


HEX_GRID is a library of C++ routines, using double precision arithmetic, which computes points on a hexagonal grid.

For one set of routines, the hexagonal grid is defined in the unit square [0,1] x [0,1]. For a matching set of routines, the hexagonal grid is defined on a coordinate box [A,B] x [C,D].

All nodes of the grid lie on one of LAYERS horizontal lines. The first of these lines is the X axis (for grids in the unit square) or the line from (A,C) to (B,C), for grids in a coordinate box. Each successive line is HY units higher.

On all the odd numbered lines, there are NODES_PER_LAYER points, equally spaced from 0 to 1 or A to B, with a spacing of HX.

On the even numbered lines, there are NODES_PER_LAYER-1 points, whose values are the midpoints of successive intervals on an odd numbered line. (The grid is staggered).

In order to maintain the hexagonal structure, the following relationship is required between HX and HY:

        HY = HX * sqrt ( 3 ) / 2.
      

Here is an image of a hexagonal grid with NODES_PER_ROW = 21 and LAYERS = 24, and a total of N = 492 nodes.

Related Data and Programs:

CVT is a C++ library of routines for computing points in a Centroidal Voronoi Tessellation.

FAURE is a C++ library of routines for computing Faure sequences.

GRID is a C++ library of routines for computing points on a grid.

HALTON is a C++ library of routines for computing Halton sequences.

HAMMERSLEY is a C++ library of routines for computing Hammersley sequences.

HEX_GRID is also available in a FORTRAN90 version and a MATLAB version.

HEX_GRID is a dataset collection which contains examples of hexagonal grids.

HEX_GRID_ANGLE is a FORTRAN90 library which computes elements of an angled hexagonal grid dataset.

HEX_GRID_DATASET is an interactive C++ program, using the HEX_GRID library, which can create a hex grid dataset and write it to a file.

HEX_GRID_TRIANGULATE is an interactive FORTRAN90 program which uses the HEX_GRID library and finds points on a hex grid that lie within a given arbitrary region.

IHS is a C++ library of routines for computing improved Latin Hypercube datasets.

LATIN_CENTER is a C++ library of routines for computing Latin square data choosing the center value.

LATIN_EDGE is a C++ library of routines for computing Latin square data choosing the edge value.

LATIN_RANDOM is a C++ library of routines for computing Latin square data choosing a random value in the square.

NIEDERREITER2 is a C++ library of routines for computing Niederreiter sequences with base 2.

NORMAL is a C++ library which computes elements of a sequence of pseudorandom normally distributed values.

SOBOL is a C++ library of routines for computing Sobol sequences.

UNIFORM is a C++ library of routines for computing uniform random values.

VAN_DER_CORPUT is a C++ library of routines for computing van der Corput sequences.

Source Code:

Examples and Tests:

List of Routines:

You can go up one level to the C++ source codes.


Last revised on 11 November 2006.