PRO triangulate_full, nc, tr, ntr ; Description: This module generates the list of all possible triangles that can be formed from ; a set of "nc" points in two dimensions. The indices of each of the three vertices ; for each triangle are returned via the array "tr", and the number of triangles ; that have been formed are returned via the parameter "ntr". ; ; Input Parameters: ; ; nc - INTEGER/LONG - The number of points for which triangles are to be formed. If this number ; is less than three, then the module returns with non-sensical values for ; the output parameters. ; ; Output Parameters: ; ; tr - LONG ARRAY - A 3 by "ntr" array of LONGS where each triplet of numbers represents the ; indices of the points corresponding to the three vertices of each triangle. ; ntr - LONG - The number of triangles that have been formed. This number is easily calculated ; from the analytical formula: ; ; ntr = nc * (nc - 1) * (nc - 2) / 6 ; ; Author: Dan Bramich (dan.bramich@hotmail.co.uk) ; ; History: ; ; 31/07/2008 - Module created (dmb) ;Check that "nc" is a number of the correct type and with a value that is greater than or equal ;to three ;Calculate the number of triangles that will be formed ;Generate an array containing the triangles formed by the set of points