自动区域简化
版本 11 改进了对特殊区域的操作,以便在可能的情况下用特殊区域的形式给出最佳表示.
单位圆盘和单位矩形相交.
In[1]:=
![Click for copyable input](assets.zh/automatic-region-simplification/In_39.png)
RegionIntersection[Disk[], Rectangle[]]
Out[1]=
![](assets.zh/automatic-region-simplification/O_24.png)
![](assets.zh/automatic-region-simplification/O_25.png)
对一个特殊区域做仿射变换.
In[2]:=
![Click for copyable input](assets.zh/automatic-region-simplification/In_40.png)
TransformedRegion[Disk[{1, 2}, {1, 2}],
AffineTransform[{{{1, 2}, {3, 1}}, {1, 2}}]]
Out[2]=
![](assets.zh/automatic-region-simplification/O_26.png)
In[3]:=
![Click for copyable input](assets.zh/automatic-region-simplification/In_41.png)
TransformedRegion[Rectangle[],
ShearingTransform[\[Pi]/4, {1, 0}, {0, 1}]]
Out[3]=
![](assets.zh/automatic-region-simplification/O_27.png)
取两个区域的积来产生一个高维的特殊区域.
In[4]:=
![Click for copyable input](assets.zh/automatic-region-simplification/In_42.png)
RegionProduct[Interval[{a, b}], Disk[{x, y}, r]]
Out[4]=
![](assets.zh/automatic-region-simplification/O_28.png)
In[5]:=
![Click for copyable input](assets.zh/automatic-region-simplification/In_43.png)
RegionProduct[Parallelepiped[{1, 1, 1}, IdentityMatrix[3]],
Rectangle[]]
Out[5]=
![](assets.zh/automatic-region-simplification/O_29.png)
计算特殊区域之间的差异.
In[6]:=
![Click for copyable input](assets.zh/automatic-region-simplification/In_44.png)
RegionDifference[Disk[{0, 0}, 2], Rectangle[{2, 2}]]
Out[6]=
![](assets.zh/automatic-region-simplification/O_30.png)
In[7]:=
![Click for copyable input](assets.zh/automatic-region-simplification/In_45.png)
RegionDifference[Cuboid[], Ball[{0, 0, 0}, 2]]
Out[7]=
![](assets.zh/automatic-region-simplification/O_31.png)