TRIANGULATE

The TRIANGULATE procedure constructs a Delaunay tri-
angulation of a planar set of points. Delaunay triangula-
tions are very useful for the interpolation, analysis, and 
visual display of irregularly gridded data. In most appli-
cations, after the irregularly gridded data points have 
been triangulated, the function TRIGRID is invoked to 
interpolate surface values to a regular grid.

Since Delaunay triangulations have the property that 
the circumcircle of any triangle in the triangulation con-
tains no other vertices in its interior, interpolated val-
ues are only computed from nearby points.

The output grid from the function TRIGRID can be input 
to various routines such as SURFACE, TV, and CONTOUR. See 
the description of TRIGRID for an example.

Calling Sequence

        TRIANGULATE, X, Y, Triangles [, B]
        
Arguments

    X
    
        An array that contains the X coordinates of the 
        points to be triangulated.
        
    Y
    
        An array that contains the Y coordinates of the 
        points to be triangulated. Parameters X and Y must 
        have the same number of elements.
        
    Triangles
    
        A named variable that, on exit, contains the 
        list of triangles in the Delaunay triangulation of 
        the points specified by X and Y. Triangles is a 
        longword array dimensioned (3, Number-of-Triangles), 
        where Triangles(0, i), Triangles(1, i), and Trian-
        gles(2, i) contain the indices of the vertices of 
        the i-th triangle (i.e., X(Tr(*, i)) and Y(Trian-
        gles(*, i)) are the X and Y coordinates of the ver-
        tices of the i-th triangle).
        
    B
    
        An optional, named variable that, upon return, 
        contains a list of the indices of the boundary 
        points in counterclockwise order.
        
Keywords

    REPEATS
    
        Set this keyword to a named variable to return a 
        (2, n) list of the indices of duplicated points. 
        That is, for each i,
        
        X(REPEATS(0,i)) = X(REPEATS(1,i))
        
        and
        
        Y(REPEATS(0,i)) = Y(REPEATS(1,i))
        
