Main Content

circumcenters

(Not recommended) Circumcenters of specified simplices

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

TriRep is not recommended. Use triangulation instead.

Description

CC = circumcenters(TR) returns the coordinates of the circumcenter of each simplex in the triangulation. The circumcenter associated with simplex i is the i'th row of CC.

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.

example

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

example

Examples

collapse all

Load a 2-D triangulation and create a TriRep object.

load trimesh2d
trep = TriRep(tri,x,y)
trep = 
  TriRep with properties:

                X: [180x2 double]
    Triangulation: [182x3 double]

Compute the circumcenters and plot them with the triangulation.

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

Figure contains an axes object. The axes object contains 2 objects of type line. One or more of the lines displays its values using only markers

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

Create a 3-D triangulation with DelaunayTri. Compute the circumcenters and radii of the first five tetrahedra.

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

    0.5265    0.0860    1.1919
    0.1626    0.3794    2.3048
    0.3089    0.1067   -0.3349
    0.5708    0.4461    0.3751
    0.2805    0.7532    0.5855

rcc = 5×1

    0.6129
    1.5666
    1.1135
    0.4706
    0.3670

Input Arguments

collapse all

Triangulation representation, specified as a TriRep or DelaunayTri object.

Simplex indices, specified as a column vector. SI contains simplex indices that index into the triangulation matrix TR.Triangulation.

Output Arguments

collapse all

Circumcenter coordinates, returned as an m-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).

Radii of circumscribed circles or spheres, returned as a vector of length length(SI), the number of specified simplices.

More About

collapse all

Simplex

A simplex is a triangle/tetrahedron or higher-dimensional equivalent.

Version History

Introduced in R2009a