Main Content

incenters

(Not recommended) Incenters of specified simplices

incenters(TriRep) is not recommended. Use incenter(triangulation) instead.

TriRep is not recommended. Use triangulation instead.

Description

example

IC = incenters(TR) returns the coordinates of the incenter for each simplex in the triangulation. The incenter associated with simplex i is the i'th row of IC.

example

IC = incenters(TR,SI) returns the coordinates of the incenter of each specified simplex SI.

[IC,RIC] = incenters(TR,SI) also returns the corresponding radius of the inscribed circle/sphere.

Examples

collapse all

Load a 3-D triangulation.

load tetmesh

Use TriRep to compute the incenters of the first five tetrahedra.

 trep = TriRep(tet,X);
 ic = incenters(trep, [1:5]')
ic = 5×3

   -6.1083  -31.0234    8.1439
   -2.1439  -31.0283    5.8742
   -1.9555  -31.9463    7.4112
   -4.3019  -30.8460   10.5169
   -3.1596  -29.3642    6.1851

Create a 2-D triangulation with DelaunayTri.

x = [0 1 1 0 0.5]';
y = [0 0 1 1 0.5]';
dt = DelaunayTri(x,y);

Compute the incenters of the triangles.

ic = incenters(dt);

Plot the triangles and incenters.

triplot(dt)
axis equal
axis([-0.2 1.2 -0.2 1.2])
hold on
plot(ic(:,1),ic(:,2),'*r')
hold off

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

Incenters of simplices, returned as a matrix. IC is an m-by-n matrix, where m = length(SI), the number of specified simplices, and n is the dimension of the space where the triangulation resides. Each row IC(i,:) represents the coordinates of the incenter of simplex SI(i).

Radius of inscribed circle/sphere, returned as a vector. Each element RIC(i) is the radius of the inscribed circle or sphere for simplex SI(i).

More About

collapse all

Simplex

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

Version History

Introduced in R2009a