# Measures

Compute the arc length of a 1D mesh, the area of a 2D mesh, or the volume of a 3D mesh.

 In[1]:= Xmesh1d = DiscretizeRegion[Circle[]]; mesh2d = DiscretizeRegion[Disk[]]; mesh3d = DiscretizeRegion[Cuboid[], MaxCellMeasure -> \[Infinity]];
 In[2]:= XGrid[{{mesh1d, mesh2d, mesh3d}, {ArcLength[mesh1d], Area[mesh2d], Volume[mesh3d]}}]
 Out[2]=

Compute the centroid of any mesh.

 In[3]:= XGrid[{{Show[mesh1d, Graphics[{Red, Point[RegionCentroid[mesh1d]]}]], Show[mesh2d, Graphics[{Red, Point[RegionCentroid[mesh2d]]}]], Show[HighlightMesh[mesh3d, Style[2, Opacity[0.3]]], Graphics3D[{Red, PointSize[Large], Point[RegionCentroid[mesh3d]]}]]}}]
 Out[3]=

Compute the volume of different levels of a procedurally generated mesh.

 In[5]:= Xt = {{{1, 0}, {1, 1}}, {{0, 0}, {1, 0}}}; meshes = ArrayPatternMesh[SierpinskiArray[t, #]] & /@ Range[6]; Grid[{Part[meshes, 1 ;; 3], Part[meshes, 4 ;; 6]}]
 Out[5]=
 In[6]:= Xvols = Volume[#] & /@ meshes
 Out[6]=

Find a function that describes the sequence of volumes.

 In[7]:= XFindSequenceFunction[Rationalize[vols], k]
 Out[7]=

## Mathematica

Questions? Comments? Contact a Wolfram expert »