Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

isEdge - Class: TriRep

Test if vertices are joined by edge

Syntax

TF = isEdge(TR, V1, V2)
TF = isEdge(TR, EDGE)

Description

TF = isEdge(TR, V1, V2) returns an array of 1/0 (true/false) flags, where each entry TF(i) is true if V1(i), V2(i) is an edge in the triangulation. V1, V2 are column vectors representing the indices of the vertices in the mesh, that is, indices into the vertex coordinate arrays.

TF = isEdge(TR, EDGE) specifies the edge start and end indices in matrix format.

Inputs

TRTriangulation representation.
V1, V2Column vectors of mesh vertices.
EDGE Matrix of size n-by-2 where n is the number of query edges.

Outputs

TFArray of 1/0 (true/false) flags, where each entry TF(i) is true if V1(i), V2(i) is an edge in the triangulation.

Examples

Example 1

Load a 2-D triangulation and use TriRep to query the presence of an edge between pairs of points.

load trimesh2d
trep = TriRep(tri, x,y);

Test if vertices 3 and 117 are connected by an edge

isEdge(trep, 3, 117)

Test if vertices 3 and 164 are connected by an edge

isEdge(trep, 3, 164)

Example 2

Direct query of a 3-D Delaunay triangulation created using DelaunayTri.

X = rand(10,3)
dt = DelaunayTri(X)

Test if vertices 2 and 7 are connected by an edge

isEdge(dt, 2, 7);

See Also

DelaunayTri

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS