Region Moments
Support of polynomial moments of a region in Version 11 provides powerful and flexible tools to compare, classify, and compute properties over regions.
Symbolically calculate moments of regions.
In[1]:=
![Click for copyable input](assets.en/region-moments/In_54.png)
RegionMoment[Disk[], {0, 0}]
Out[1]=
![](assets.en/region-moments/O_38.png)
In[2]:=
![Click for copyable input](assets.en/region-moments/In_55.png)
RegionMoment[CapsuleShape[], {2, 0, 0}]
Out[2]=
![](assets.en/region-moments/O_39.png)
In[3]:=
![Click for copyable input](assets.en/region-moments/In_56.png)
RegionMoment[Cone[{{0, 0, 0}, {0, 0, 1}}, r], {2, 0, 0}]
Out[3]=
![](assets.en/region-moments/O_40.png)
Suppose a region with unknown parameters is provided, along with the knowledge that all zero-order and first-order moments are 1. Find the numerical values of each parameter.
Define the region and the assumptions on its parameters.
In[4]:=
![Click for copyable input](assets.en/region-moments/In_57.png)
$Assumptions = r > 0 && x > 0 && y > 0 && z > 0;
In[5]:=
![Click for copyable input](assets.en/region-moments/In_58.png)
cyl = Cylinder[{{0, 0, 0}, {x, y, z}}, r];
Calculate its zero-order and first-order moments.
In[6]:=
![Click for copyable input](assets.en/region-moments/In_59.png)
cfs = {{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
In[7]:=
![Click for copyable input](assets.en/region-moments/In_60.png)
{m0, m100, m010, m001} = Table[RegionMoment[cyl, c], {c, cfs}]
Out[7]=
![](assets.en/region-moments/O_41.png)
Solve for the parameters, given that all zero-order and first-order moments are 1.
In[8]:=
![Click for copyable input](assets.en/region-moments/In_61.png)
sol = Solve[{m0 == 1, m100 == 1, m010 == 1, m001 == 1, $Assumptions}]
Out[8]=
![](assets.en/region-moments/O_42.png)
Obtain the region.
In[9]:=
![Click for copyable input](assets.en/region-moments/In_62.png)
cyl /. sol
Out[9]=
![](assets.en/region-moments/O_43.png)
Approximate its radius.
In[10]:=
![Click for copyable input](assets.en/region-moments/In_63.png)
N[cyl /. sol]
Out[10]=
![](assets.en/region-moments/O_44.png)