Delaunay's Triangulation

DESCRIPTION:

Calculate Delaunays triangulation for points with given coordinates x and y.

USAGE:

triangulate(x, y, plot.it=T, shrink=0.1) 

REQUIRED ARGUMENTS:

x
a list with components "x" and "y", a 2-column matrix, or a vector containing the horizontal coordinates of the vertices that form the polygon of interest.

OPTIONAL ARGUMENTS:

y
if x is a vector of X-coordinates then y must contain the corresponding vertical or Y-coordinates.
plot.it
logical flag: should the resulting triangulation be plotted? Default is TRUE.
shrink
fraction by which the triangles will be shrunken for better discrimination of the individual triangles in the plot, no edges overlap if `shrink > 0'.

VALUE:

invisibly returns a list with 2 components:
ipt
a matrix with 3 rows, for each column the 3 row-values can be used to index x and y and extract corresponding triangle vertices. This provides an ordering of the triangles as well.
ipl
another integer matrix with 3 rows. These are the point numbers of the end points of the border line segments and their corresponding triangle number.

SIDE EFFECTS:

if plot.it = TRUE a colorful representation of the triangulation is produced.

DETAILS:

A Delaunay triangulation of a point set is a triangulation whose vertices are the point set, with the property that no point in the point set falls in the interior of the circumcircle (circle that passes through all three vertices) of any triangle in the triangulation.

EXAMPLES:

triangulate(scallops[,c("lat","long")])