hex_grid, a Fortran90 code 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.
The information on this web page is distributed under the MIT license.
hex_grid is available in a C++ version and a Fortran90 version and a MATLAB version.
cvt, a Fortran90 code which computes elements of a Centroidal Voronoi Tessellation.
faure, a Fortran90 code which computes elements of a Faure quasirandom sequence.
grid, a Fortran90 code which computes elements of a grid dataset.
halton, a Fortran90 code which computes elements of a Halton quasirandom sequence.
hammersley, a Fortran90 code which computes elements of a Hammersley quasirandom sequence.
hex_grid, a dataset collection which contains examples of hexagonal grids.
hex_grid_angle, a Fortran90 code which computes elements of an angled hexagonal grid dataset.
hex_grid_dataset, a Fortran90 code which can create a hex grid dataset and write it to a file.
hex_grid_triangulate, a Fortran90 code which uses hex_grid() and finds points on a hex grid that lie within a given arbitrary region.
ihs, a Fortran90 code which computes elements of an improved distributed Latin hypercube dataset.
latin_center, a Fortran90 code which computes elements of a Latin Hypercube dataset, choosing center points.
latin_edge, a Fortran90 code which computes elements of a Latin Hypercube dataset, choosing edge points.
latin_random, a Fortran90 code which computes elements of a Latin Hypercube dataset, choosing points at random.
lattice_rule, a Fortran90 code which approximates multidimensional integrals using lattice rules.
lcvt, a Fortran90 code which computes a latinized Centroidal Voronoi Tessellation.
niederreiter2, a Fortran90 code which computes elements of a Niederreiter quasirandom sequence with base 2.
normal, a Fortran90 code which computes elements of a sequence of pseudorandom normally distributed values.
sobol, a Fortran90 code which computes elements of a Sobol quasirandom sequence.
triangle_grid, a Fortran90 code which computes a triangular grid of points.
uniform, a Fortran90 code which computes elements of a uniform pseudorandom sequence.
van_der_corput, a Fortran90 code which computes elements of a van der Corput quasirandom sequence.