This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

triangulation class

Triangulation in 2-D or 3-D


Use triangulation to create an in-memory representation of any 2-D or 3-D triangulation data that is in matrix format, such as the matrix output from the delaunay function or other software tools. When your data is represented using triangulation, you can perform topological and geometric queries, which you can use to develop geometric algorithms. For example, you can find the triangles or tetrahedra attached to a vertex, those that share an edge, their circumcenters, and other features.


TR = triangulation(T,P) creates a 2-D or 3-D triangulation representation using the triangulation connectivity list, T, and the points in matrix P.

TR = triangulation(T,x,y) creates a 2-D triangulation representation with the point coordinates specified as column vectors, x and y.

TR = triangulation(T,x,y,z) creates a 3-D triangulation representation with the point coordinates specified as column vectors, x, y, and z.

Input Arguments


Triangulation connectivity list, specified as an m-by-n matrix, where m is the number of triangles or tetrahedra, and n is the number of vertices per triangle or tetrahedron. Each element in T is a Vertex ID. Each row of T contains the vertex IDs that define a triangle or tetrahedron.


Points, specified as a matrix whose columns are the x, y, (and possibly z) coordinates of the triangulation points. The row numbers of P are the vertex IDs in the triangulation.


x-coordinates vector, specified as a column vector containing the x-coordinates of the triangulation points.


y-coordinates vector, specified as a column vector containing the y-coordinates of the triangulation points.


z-coordinates vector, specified as a column vector containing the z-coordinates of the triangulation points.



Points in the triangulation, represented as a matrix containing the following information:

  • Each row in TR.Points contains the coordinates of a vertex.

  • Each row number of TR.Points is a vertex ID.


Triangulation connectivity list, represented as a matrix. This matrix contains the following information:

  • Each element in TR.ConnectivityList is a vertex ID.

  • Each row represents a triangle or tetrahedron in the triangulation.

  • Each row number of TR.ConnectivityList is a Triangle or Tetrahedron ID.


barycentricToCartesianConverts point coordinates from barycentric to Cartesian
cartesianToBarycentricConverts point coordinates from Cartesian to barycentric
circumcenterCircumcenter of triangle or tetrahedron
edgeAttachmentsTriangles or tetrahedra attached to specified edge
edgesTriangulation edges
faceNormalTriangulation face normal
featureEdgesTriangulation sharp edges
freeBoundaryTriangulation facets referenced by only one triangle or tetrahedron
incenterIncenter of triangle or tetrahedron
isConnectedTest if two vertices are connected by edge
nearestNeighborVertex closest to specified location
neighborsNeighbors to specified triangle or tetrahedron
pointLocationTriangle or tetrahedron containing specified point
sizeSize of triangulation connectivity list
vertexAttachmentsTriangles or tetrahedra attached to specified vertex
vertexNormalTriangulation vertex normal


Vertex ID

A row number of the matrix, TR.Points. Use this ID to refer a specific vertex in the triangulation.

Triangle or Tetrahedron ID

A row number of the matrix, TR.ConnectivityList. Use this ID to refer a specific triangle or tetrahedron.

Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects in the MATLAB® documentation.


expand all

Define the points in the triangulation.

P = [ 2.5    8.0
      6.5    8.0
      2.5    5.0
      6.5    5.0
      1.0    6.5
      8.0    6.5];

Define the triangles. This is the triangulation connectivity list.

T = [5  3  1;
     3  2  1;
     3  4  2;
     4  6  2];

Create the triangulation representation.

TR = triangulation(T,P)
TR = 

  triangulation with properties:

              Points: [6×2 double]
    ConnectivityList: [4×3 double]

Examine the coordinates of the vertices of the first triangle.

ans =

    1.0000    6.5000
    2.5000    5.0000
    2.5000    8.0000

Was this topic helpful?