Circumcenter of triangle or tetrahedron
Load 2-D triangulation data and create a triangulation representation.
load trimesh2d TR = triangulation(tri,x,y);
Compute the circumcenters of each triangle in
C = circumcenter(TR);
Plot the triangulation along with the circumcenters in red. The -coordinates of the circumcenters are contained in the first column of
C and the corresponding -coordinates are contained in the second column.
triplot(TR) axis([-100 400 -50 350]) hold on plot(C(:,1),C(:,2),'r.') hold off
Create a Delaunay triangulation for a set of points.
P = gallery('uniformdata',10,3,0); TR = delaunayTriangulation(P);
Compute the circumcenters of the first five tetrahedra in
TR, and the radii of their circumscribed spheres.
[C,r] = circumcenter(TR,[1:5]')
C = 5×3 0.9626 0.3892 0.0928 6.3458 0.2377 3.1814 0.4820 0.9064 0.5176 -1.2993 1.8384 -1.2185 -0.1595 1.0852 -0.2536
r = 5×1 0.2292 6.2460 0.3212 2.4303 0.7787
ID— Triangle or tetrahedron identification
Triangle or tetrahedron identification, specified as a scalar or a column
vector whose elements each correspond to a single triangle or tetrahedron in
the triangulation object. The identification number of each triangle or
tetrahedron is the corresponding row number of the
Circumcenters of triangles or tetrahedra, returned as a two-column matrix for 2-D coordinates or a three-column matrix for 3-D coordinates.
Radii of the circumscribed circles or spheres, returned as a scalar or vector.