TRIANGULATE_RECTANGLE
Triangulate a Rectangular Region
TRIANGULATE_RECTANGLE
is a MATLAB library which
computes a simple triangulation of a rectangular region.
The triangulation will be represented by two sets of data:

node coordinates, a set of NN pairs (X(I),Y(I)) that are
the coordinates of points used to define the triangulation,
stored as a 2xNN real array.

elements, a set of NE triples (I1(J),I2(J),I3(J))
that are the indices of the nodes forming the vertex of triangle J,
stored as a 3xNE integer array. For each triangle, the nodes
are listed in counterclockwise order.
Usage:
triangulate_rectangle ( xl, xr, xn,
yb, yt, yn, base )

xl, xr are the left and rightmost X coordinates.

xn is the number of elements along the X direction.

yb, yt are the bottom and topmost Y coordinates.

yn is the number of elements along the Y direction.

base is an optional input that is 1 for 1based element
indexing (default), or 0 for 0based indexing.
Licensing:
The computer code and data files made available on this web page
are distributed under
the GNU LGPL license.
Languages:
TRIANGULATE_RECTANGLE is available in
a MATLAB version.
Related Data and Programs:
FEM2D_POISSON_RECTANGLE_LINEAR,
a MATLAB program which
solves the 2D Poisson equation on a rectangle,
using the finite element method (FEM),
and piecewise linear triangular elements.
TRIANGULATION,
a MATLAB library which
performs various operations on order 3 (linear) or order 6 (quadratic)
triangulations, including searching a Delaunay triangulation to find
which triangle contains a given point.
TRIANGULATION_DISPLAY,
a MATLAB program which
displays the nodes and elements of a triangulation
on the MATLAB graphics screen;
Source Code:

i4mat_transpose_print.m,
prints an I4MAT, transposed;

i4mat_transpose_print_some.m,
prints some of an I4MAT, transposed;

i4mat_write.m,
writes an I4MAT out to a file.

r8mat_transpose_print.m,
prints the transpose of an R8MAT;

r8mat_transpose_print_some.m,
prints some of the transpose of an R8MAT;

r8mat_write.m,
writes an R8MAT out to a file.

timestamp.m,
prints the current YMDHMS date as a time stamp.

triangulate_rectangle.m,
decomposes a rectangle into a grid of triangles, creating
a set of nodes, and a set of elements.
Examples and Tests:
You can go up one level to
the MATLAB source codes.
Last modified on 31 March 2015.