# HEX_GRID_DATASET Interactive Creation of Hexagonal Grid Datasets

HEX_GRID_DATASET is a FORTRAN90 program which allows the user to interactively create a dataset of points on a hexagonal grid.

The user specifies just a few quantities:

• (X1,Y1), the lower left coordinate of a box.
• (X2,Y2), the upper right coordinate of a box.
• NODES_PER_LAYER, the number of nodes to use on the first line, from (X1,Y1) to (X2,Y1).

This is all it takes to define the grid. Note that the points (X1,Y1) and (X2,Y1) will be grid points, but generally the grid will not quite reach (X1,Y2) and (X2,Y2).

Once the dataset is defined and computed, it is written to a file. The user may then construct another dataset, or terminate the program.

The hexagonal grid is defined on a coordinate box whose lower left corner is (X1,Y1) and whose upper right corner is (X2,Y2).

All nodes of the grid lie on one of LAYERS horizontal lines. The first of these lines is the line from (X1,Y1) to (X2,Y1). Each successive line is a distance HY units higher.

On all the odd numbered lines, there are NODES_PER_LAYER points, equally spaced from X1 to X2, 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. ### Languages:

HEX_GRID_DATASET is available in a C++ version and a FORTRAN90 version and a MATLAB version.

### Related Data and Programs:

FAURE_DATASET, a FORTRAN90 program which creates a Faure quasirandom dataset;

GRID_DATASET, a FORTRAN90 program which creates a grid sequence and writes it to a file.

HEX_GRID, a FORTRAN90 library which computes elements of a hexagonal grid dataset.

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

LATIN_CENTER_DATASET, a FORTRAN90 program which creates a Latin Center Hypercube dataset;

LATIN_EDGE_DATASET, a FORTRAN90 program which creates a Latin Edge Hypercube dataset;

LATIN_RANDOM_DATASET, a FORTRAN90 program which creates a Latin Random Hypercube dataset;

NIEDERREITER2_DATASET, a FORTRAN90 program which creates a Niederreiter quasirandom dataset with base 2;

NORMAL_DATASET, a FORTRAN90 program which generates a dataset of multivariate normal pseudorandom values and writes them to a file.

SOBOL_DATASET, a FORTRAN90 program which computes a Sobol quasirandom sequence and writes it to a file.

UNIFORM_DATASET, a FORTRAN90 program which generates a dataset of multivariate uniform pseudorandom values and writes them to a file.

VAN_DER_CORPUT_DATASET, a FORTRAN90 program which creates a van der Corput quasirandom sequence and writes it to a file.

### List of Routines:

• MAIN is the main program for HEX_GRID_DATASET.

You can go up one level to the FORTRAN90 source codes.

Last revised on 30 August 2005.