DELAUNAY_LMAP_2D
Delaunay Triangulations Under Linear Maps
DELAUNAY_LMAP_2D is a FORTRAN90 program,
using double precision arithmetic,
which computes the Delaunay triangulation of a set of
points in the plane that have been transformed by a linear map A.
Specifically, DELAUNAY_LMAP_2D reads two input files:
-
a node file containing (many) point coordinates (X,Y);
-
a map file containing the entries of the 2x2 matrix
A that describes the linear distortion of the geometry;
The program then implicitly multiplies each point (X,Y)
by A and computes the Delaunay triangulation of the
transformed points (AX,AY).
It then writes out
-
an order 3 triangulation file, listing the indices of
the 3 nodes that form each Delaunay triangle,
-
an
Encapsulated PostScript file containing an image of
the triangulation.
In a sense, there's no reason to do all this fancy stuff.
You can simply multiply your data by A yourself, get the Delaunay
triangulation of the transformed data, and then recover your
original data.
The main reason for setting up this code is
to prepare for cases that are a generalization of this one,
in which the matrix A actually varies spatially.
Related Data and Programs:
BIVAR
is a FORTRAN90 library which
computes a function F(X,Y) that interpolates scattered data.
GEOMPACK
is a FORTRAN90 library which
computes Delaunay triangulations, written by Barry Joe.
QSHEP2D
is a FORTRAN90 library which
computes a function F(X,Y) that interpolates scattered data.
STRIPACK
is a FORTRAN90 library which
computes the Delaunay triangulation or Voronoi diagram
of points on a sphere.
TABLE
is a simple file format which
can be used for tables of real or integer data.
TABLE_DELAUNAY
is a FORTRAN90 program which
reads a file of point coordinates in the TABLE format and writes out
the Delaunay triangulation.
TRIANGULATION_DISPLAY_OPEN_GL
is a C++ program which
reads files defining a triangulation and displays an image
using Open GL.
TRIANGULATION_ORDER3
is an data directory which
contains a description and examples of the
information needed to describe an order 3 triangulation of a set of nodes..
TRIANGULATION_PLOT
is a FORTRAN90 program which
may be used to make a PostScript image of
the triangulation of the points.
TRIPACK
is a FORTRAN90 library which
computes the Delaunay triangulation of points in the plane.
Usage:
-
delaunay_lmap_2d points.txt matrix.txt
-
reads the point coordinates in points.txt and the
scaling matrix in matrix.txt, and computes the
Delaunay triangularization of the scaled data.
Reference:
-
Franz Aurenhammer,
Voronoi diagrams -
a study of a fundamental geometric data structure,
ACM Computing Surveys,
Volume 23, Number 3, September 1991, pages 345-405.
-
Marc deBerg, Marc Krevald, Mark Overmars,
Otfried Schwarzkopf,
Computational Geometry,
Springer, 2000,
ISBN: 3-540-65620-0.
-
Barry Joe,
GEOMPACK - a software package for the generation of meshes
using geometric algorithms,
Advances in Engineering Software,
Volume 13, Number 5, 1991, pages 325-331.
-
Joseph ORourke,
Computational Geometry,
Second Edition,
Cambridge, 1998,
ISBN: 0521649765,
LC: QA448.D38.
-
Some Notes on Delaunay Triangulations
Source Code:
Examples and Tests:
Test matrices you can copy include:
-
matrix_identity.txt,
the identity matrix.
-
matrix_d21.txt,
the (2,1) dilation.
-
matrix_d41.txt,
the (4,1) dilation.
-
matrix_d81.txt,
the (8,1) dilation.
-
matrix_d15.txt,
the (1,5) dilation.
-
matrix_r30.txt,
the 30 degree rotation (should have no effect on Delaunay).
-
matrix_r30d21.txt,
the (2,1) dilation and 30 degree rotation.
-
matrix_r30d41.txt,
the (4,1) dilation and 30 degree rotation.
-
matrix_r30d81.txt,
the (8,1) dilation and 30 degree rotation.
POINTS is a set of 10 "random" points in the unit square. Test
files you may copy include:
-
points.txt,
a (real) TABLE file describing the coordinates of the points.
-
points.identity.delaunay.txt,
the (integer) TABLE file, describing
the Delaunay triangulation of the points under the identity map.
-
points.identity.delaunay.png,
a PNG image of
the triangulated data.
-
points.d21.delaunay.png,
a PNG image of
the triangulated data under the D21 matrix.
-
points.d41.delaunay.png,
a PNG image of
the triangulated data under the D41 matrix.
-
points.d81.delaunay.png,
a PNG image of
the triangulated data under the D81 matrix.
-
points.rot30.delaunay.png,
a PNG image of
the triangulated data under the R30 matrix.
-
points.r30d21.delaunay.png,
a PNG image of
the triangulated data under the R30D21 matrix.
-
points.r30d41.delaunay.png,
a PNG image of
the triangulated data under the R30D41 matrix.
-
points.r30d81.delaunay.png,
a PNG image of
the triangulated data under the R30D81 matrix.
DOUBLE_HEX2_CVT is a set of 139 points in the unit square
with two hexagonal holes. Test files you may copy include:
GRID105 is a set of 105 points in the unit square, arranged
into 5 columns of 21 points each. The points were originally
evenly spaced in the X direction, and evenly spaced in the Y
direction, but a uniform random perturbation of scale 0.03
was applied to both coordinates of every point. Because the
data has been compressed by a factor of 5 in the Y direction,
we get some "ugly" triangles if we do a Delaunay triangulation
directly on the data. However, if we use a (1,5) dilation
matrix to uncompress the Y direction, the triangles look much
nicer (except along the boundary, where we are powerless to help).
Test files you may copy include:
List of Routines:
-
MAIN is the main program for DELAUNAY_LMAP_2D.
-
CH_CAP capitalizes a single character.
-
CH_EQI is a case insensitive comparison of two characters for equality.
-
CH_TO_DIGIT returns the integer value of a base 10 digit.
-
DIAEDG_LMAP chooses a diagonal edge under a linear map.
-
DTABLE_DATA_PRINT prints a real table dataset.
-
DTABLE_DATA_PRINT_SOME prints some of a real table dataset.
-
DTABLE_DATA_READ reads real table data from a file.
-
DTABLE_HEADER_READ reads header data from a file.
-
DTRIS2_LMAP constructs a Delaunay triangulation of 2D linear mapped vertices.
-
FILE_COLUMN_COUNT counts the number of columns in the first line of a file.
-
FILE_NAME_EXT_GET determines the "extension" of a file name.
-
FILE_NAME_EXT_SWAP replaces the current "extension" of a file name.
-
FILE_ROW_COUNT counts the number of row records in a file.
-
GET_UNIT returns a free FORTRAN unit number.
-
I4_MODP returns the nonnegative remainder of integer division.
-
I4_WRAP forces an integer to lie between given limits by wrapping.
-
I4VEC_INDICATOR sets an I4VEC to the indicator vector.
-
I4VEC_SORT_HEAP_INDEX_A does an indexed heap ascending sort of an I4VEC.
-
ITABLE_DATA_PRINT_SOME prints some of an integer table dataset.
-
ITABLE_DATA_WRITE writes an integer table dataset to a file.
-
ITABLE_HEADER_WRITE writes the table header data to a file.
-
ITABLE_TRIANGULATION_WRITE writes an integer triangulation table to a file.
-
LRLINE determines if a point is left of, right or, or on a directed line.
-
PERM_INV inverts a permutation "in place".
-
R82VEC_PERMUTE permutes an R82VEC in place.
-
R82VEC_SORT_HEAP_INDEX_A does an indexed heap ascending sort of an R82VEC.
-
S_BLANK_DELETE removes blanks from a string, left justifying the remainder.
-
S_INDEX_LAST finds the LAST occurrence of a given substring.
-
S_TO_R8 reads an R8 from a string.
-
S_TO_R8VEC reads an R8VEC from a string.
-
S_WORD_COUNT counts the number of "words" in a string.
-
SWAPEC_LMAP swaps diagonal edges until all triangles are Delaunay.
-
TIMESTAMP prints the current YMDHMS date as a time stamp.
-
TIMESTRING writes the current YMDHMS date into a string.
-
TRANSFORM_LMAP applies a transformation matrix to a vector.
-
TRIANGULATION_PLOT_EPS creates an EPS file image of a triangulation.
-
VBEDG determines which boundary edges are visible to a point.
You can go up one level to
the FORTRAN90 source codes.
Last revised on 26 November 2006.