circumcenters

Class: TriRep

(Not recommended) Circumcenters of specified simplices

Compatibility

Note

circumcenters(TriRep) is not recommended. Use circumcenter(triangulation) instead.

TriRep is not recommended. Use triangulation instead.

Syntax

CC = circumcenters(TR, SI)
[CC RCC] = circumcenters(TR, SI)

Description

CC = circumcenters(TR, SI) returns the coordinates of the circumcenter of each specified simplex SI. CC is an m-by-n matrix, where m is of length length(SI), the number of specified simplices, and n is the dimension of the space where the triangulation resides.

[CC RCC] = circumcenters(TR, SI) returns the circumcenters and the corresponding radii of the circumscribed circles or spheres.

Input Arguments

TRTriangulation object.
SIColumn vector of simplex indices that index into the triangulation matrix TR.Triangulation. If SI is not specified the circumcenter information for the entire triangulation is returned, where the circumcenter associated with simplex i is the i'th row of CC.

Output Arguments

CCm-by-n matrix. m is the number of specified simplices and n is the dimension of the space where the triangulation resides. Each row CC(i,:) represents the coordinates of the circumcenter of simplex SI(i).
RCCVector of length length(SI), the number of specified simplices containing radii of the circumscribed circles or spheres.

Examples

Example 1

Load a 2-D triangulation.

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

Compute the circumcenters.

cc = circumcenters(trep);
triplot(trep);
axis([-50 350 -50 350]);
axis equal;
hold on; 
plot(cc(:,1),cc(:,2),'*r'); 
hold off;

The circumcenters represent points on the medial axis of the polygon.

Example 2

Query a 3-D triangulation created with DelaunayTri. Compute the circumcenters of the first five tetrahedra.

 X = rand(10,3);
 dt = DelaunayTri(X);
 cc = circumcenters(dt, [1:5]')

More About

expand all