# Documentation

### This is machine translation

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

# delaunayTriangulation class

Superclasses: triangulation

Delaunay triangulation in 2-D and 3-D

## Description

Use the `delaunayTriangulation` class to create a 2-D or 3-D triangulation from a set of points. When your points are in 2-D, you can specify edge constraints .

You can perform a variety of topological and geometric queries on a `delaunayTriangulation`, including any `triangulation` query. For example, locate a facet that contains a specific point, find the vertices of the convex hull, or compute the Voronoi Diagram.

## Construction

`DT = delaunayTriangulation(P)` creates a Delaunay triangulation from the points in `P`. Matrix `P` has 2 or 3 columns, depending on whether your points are in 2-D or 3-D space.

`DT = delaunayTriangulation(P,C)` specifies the edge constraints in matrix `C`. In this case, `P` specifies points in 2-D. Each row of `C` defines the start and end vertex IDs of a constrained edge.

`DT = delaunayTriangulation(x,y)` creates a 2-D Delaunay triangulation from the point coordinates in the column vectors, `x` and `y`.

`DT = delaunayTriangulation(x,y,C)` specifies the edge constraints in matrix `C`.

`DT = delaunayTriangulation(x,y,z)` creates a 3-D Delaunay triangulation from the point coordinates in the column vectors, `x`, `y`, and `z`.

`DT = delaunayTriangulation()` creates an empty Delaunay triangulation.

### Input Arguments

 `P` Input 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` x-coordinates vector, specified as a column vector containing the x-coordinates of the triangulation points. `y` y-coordinates vector, specified as a column vector containing the y-coordinates of the triangulation points. `z` z-coordinates vector, specified as a column vector containing the z-coordinates of the triangulation points. `C` Vertex IDs of constrained edges, specified as a 2-column matrix. Each row of `C` corresponds to a constrained edge and contains two IDs:`C(j,1)` is the ID of the vertex at the start of an edge.`C(j,2)` is the ID of the vertex at end of the edge.You can specify edge constraints for 2-D triangulations only.

## Properties

 ` Points` Points in the triangulation, represented as a matrix containing the following information: Each row in `DT.Points` contains the coordinates of a vertex.Each row number of `DT.Points` is a vertex ID.
 `ConnectivityList` Triangulation connectivity list, represented as a matrix. This matrix contains the following information:Each row represents a triangle or tetrahedron in the triangulation.Each row number of `DT.ConnectivityList` is a Triangle or Tetrahedron ID.Each element is a vertex ID.
 `Constraints` Constrained edges, represented as a two-column matrix of vertex IDs. Each row of `DT.Constraints` corresponds to a constrained edge and contains two IDs: `DT.Constraints(j,1)` is the ID of the vertex at the start of an edge.`DT.Constraints(j,2)` is the ID of the vertex at end of the edge. `DT.Constraints` is an empty matrix when the triangulation has no constrained edges.

## Methods

 convexHull Convex hull isInterior Test if triangle is in interior of 2-D constrained Delaunay triangulation voronoiDiagram Voronoi diagram

### Inherited Methods

 barycentricToCartesian Converts point coordinates from barycentric to Cartesian cartesianToBarycentric Converts point coordinates from Cartesian to barycentric circumcenter Circumcenter of triangle or tetrahedron edgeAttachments Triangles or tetrahedra attached to specified edge edges Triangulation edges faceNormal Triangulation face normal featureEdges Triangulation sharp edges freeBoundary Triangulation facets referenced by only one triangle or tetrahedron incenter Incenter of triangle or tetrahedron isConnected Test if two vertices are connected by edge nearestNeighbor Vertex closest to specified location neighbors Neighbors to specified triangle or tetrahedron pointLocation Triangle or tetrahedron containing specified point size Size of triangulation connectivity list vertexAttachments Triangles or tetrahedra attached to specified vertex vertexNormal Triangulation vertex normal

## Copy Semantics

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

## Examples

expand all

Create a 2-D `delaunayTriangulation` for 30 random points.

```P = gallery('uniformdata',[30 2],0); DT = delaunayTriangulation(P)```
```DT = delaunayTriangulation with properties: Points: [30×2 double] ConnectivityList: [50×3 double] Constraints: [] ```

Plot the triangulation.

```figure triplot(DT)```

Create a 3-D `delaunayTriangulation` for 30 random points.

```x = gallery('uniformdata',[30 1],0); y = gallery('uniformdata',[30 1],1); z = gallery('uniformdata',[30 1],2); DT = delaunayTriangulation(x,y,z)```
```DT = delaunayTriangulation with properties: Points: [30×3 double] ConnectivityList: [111×4 double] Constraints: [] ```

Plot the triangulation at 30% opacity with a light blue face color.

```faceColor = [0.6875 0.8750 0.8984]; figure tetramesh(DT,'FaceColor',faceColor,'FaceAlpha',0.3);```

expand all