# 派生領域

 In[1]:= Xr1 = Disk[{-1/2, 0}]; r2 = Disk[{1/2, 0}];
 In[2]:= Xd1 = RegionUnion[r1, r2]; d2 = RegionIntersection[r1, r2]; d3 = RegionDifference[r1, r2]; d4 = RegionSymmetricDifference[r1, r2];
 In[3]:= XTable[Show[BoundaryDiscretizeRegion[r], PlotRange -> {{-1.65, 1.65}, {-1.1, 1.1}}, PlotLabel -> Head[r]], {r, {d1, d2, d3, d4}}]
 Out[3]=

 In[4]:= Xr = DiscretizeGraphics[Cuboid[]]
 Out[4]=
 In[5]:= Xt1 = ScalingTransform[{2, 1, 1}]; t2 = RotationTransform[\[Pi]/3, {1, 1, 1}]; t3 = ShearingTransform[\[Pi]/6, {1, 1, 0}, {0, 0, 1}]; t4 = Composition[t3, t2, t1];
 In[6]:= XTable[TransformedRegion[r, t], {t, {t1, t2, t3, t4}}]
 Out[6]=

 In[7]:= XCantorLine[n_Integer?NonNegative] := Module[{ints, cantor = {a_, b_} :> {{a, a + (b - a)/3}, {a + (b - a) 2/3, b}}}, ints = Nest[ Flatten[Map[Function[s, s /. cantor], #], 1] &, {{0, 1}}, n]; MeshRegion[Transpose[{Flatten[ints]}], Line@Table[{i, i + 1}, {i, 1, Length[ints] 2, 2}]]]
 In[8]:= XTable[CantorLine[k], {k, 0, 3}]
 Out[8]=
 In[9]:= XRegionProduct[CantorLine[3], CantorLine[3]]
 Out[9]=
 In[10]:= XRegionProduct[CantorLine[3], CantorLine[3], CantorLine[3]]
 Out[10]=

## Mathematica

Questions? Comments? Contact a Wolfram expert »