Main Content

Triangulations

Triangulations are often used to represent 2-D and 3-D geometric domains in application areas such as computer graphics, physical modeling, geographic information systems, medical imaging, and more. The map polygon shown here

Plot of land mass with a rough border.

can be represented by the triangulation on the map shown below.

Plot of a land mass with a rough border that has triangles of various sizes superimposed.

The triangulation decomposes a complex polygon into a collection of simpler triangular polygons. You can use these polygons for developing geometric-based algorithms or graphics applications.

Similarly, you can represent the boundary of a 3-D geometric domain using a triangulation. The figure below shows the convex hull of a set of points in 3-D space. Each facet of the hull is a triangle.

Plot of 3-D shape boundary formed by triangles of various sizes.

You can represent and query the following types of triangulations using MATLAB®:

  • 2-D triangulations consisting of triangles bounded by vertices and edges

  • 3-D surface triangulations consisting of triangles bounded by vertices and edges

  • 3-D triangulations consisting of tetrahedra bounded by vertices, edges, and faces

MATLAB uses a matrix format to represent triangulations. This format has two parts:

  • The vertices, represented as a matrix in which each row contains the coordinates of a point in the triangulation.

  • The triangulation connectivity, represented as a matrix in which each row defines a triangle or tetrahedron.

This figure shows a simple 2-D triangulation.

Plot of triangulation consisting of six vertices and four triangles, with each vertex and triangle labeled.

The following table shows the vertex information.

Vertices
Vertex IDx-coordinatey-coordinate
V12.58.0
V26.58.0
V32.55.0
V46.55.0
V51.06.5
V68.06.5

The data in the previous table is stored as a matrix in the MATLAB environment. The vertex IDs are labels used for identifying specific vertices. They are shown to illustrate the concept of a vertex ID, but they are not stored explicitly. Instead, the row numbers of the matrix serve as the vertex IDs.

The triangulation connectivity data is shown in this table.

Connectivity
Triangle IDIDs of Bounding Vertices
T1531
T2321
T3342
T4462

The data in this table is stored as a matrix in the MATLAB environment. The triangle IDs are labels used for identifying specific triangles. They are shown to illustrate the concept of a triangle ID, but they are not stored explicitly. Instead, the row numbers of the matrix serve as the triangle IDs.

You can see that triangle T1 is defined by three vertices, {V5, V3, V1}. Similarly, T4 is defined by the vertices, {V4, V6, V2}. This format extends naturally to higher dimensions, which require additional columns of data. For example, a tetrahedron in 3-D space is defined by four vertices, each of which have three coordinates, (x, y, z).

The matrix format provides a compact low-level, array-based representation for triangulations. When you use triangulations to develop algorithms, you might need more information about the geometric properties, topology, and adjacency information.

For example, you might compute the triangle incenters before plotting the annotated triangulation shown below. In this case, you use the incenters to display the triangle labels (T1, T2, etc.) within each triangle. If you want to plot the boundary in red, you need to determine the edges that are referenced by only one triangle.

Triangulation consisting of six vertices and four triangles, with the outer border outlined in red.