Symbolic Computing with Geometric Regions - Development Version Demo

Adam Strzeboński, Wolfram Research

Paweł Strzeboński

Join the Conversation #WolframTechConf

Region topology

The development version of Mathematica can compute various topological operations on semialgebraic regions. The key method here is the CAD adjacency algorithm.

AppendTo[$ContextPath,"Region`"];
regs={ParametricRegion[{{t,((t^2)/2)},-3≤t≤3},{t}],Disk[{0,0},4],Ellipsoid[{0,-1},{(7/4),2}],Disk[{0,-(1/2)},2],Disk[{-(3/2),1},(3/4)],Disk[{(3/2),1},(3/4)],Disk[{-(14/10),(11/10)},(1/4)],Disk[{(16/10),(11/10)},(1/4)],Circle[{-(46/15),(1058/225)},((Sqrt[9181])/450)],Circle[{(46/15),(1058/225)},((Sqrt[9181])/450)]};
R=RegionCylindricalDecomposition[BooleanRegion[((#1||(#2&&!#3)||#4)&&!#5&&!#6)||#7||#8||#9||#10&,regs]]

SemialgebraicRegionPlot[R,{{-5,5},{-5,5}}]

Closure

Compute the topological closure of the region:

SemialgebraicRegionClosure[R]

SemialgebraicRegionPlot[%,{{-5,5},{-5,5}}]

Interior

Compute the topological interior of the region:

SemialgebraicRegionInterior[R]

SemialgebraicRegionPlot[%,{{-5,5},{-5,5}}]

Boundary

Compute the topological boundary of the region:

SemialgebraicRegionBoundary[R]

SemialgebraicRegionPlot[%,{{-5,5},{-5,5}}]

Closure of interior

Compute the closure of the interior the region:

SemialgebraicRegionInteriorClosure[R]

SemialgebraicRegionPlot[%,{{-5,5},{-5,5}}]

Connected components

Compute the connected components of the region:

SemialgebraicRegionComponents[R]

SemialgebraicRegionPlot[#,{{-5,5},{-5,5}}]&/@%

Gaussian decomposition

Compute the Gaussian decomposition of a real algebraic curve:

f=ComplexExpand[Re[z^7-3z^3+5z^2/.z->x+I y]];
comp=Join@@SemialgebraicRegionComponents/@SemialgebraicRegionBoundary/@SemialgebraicRegionComponents[R=ImplicitRegion[f>0,{x,y}]]

SeedRandom[2];Show[SemialgebraicRegionPlot[#,{{-5,5},{-5,5}},"LineInColor"->Hue[Random[]]]&/@Prepend[comp,R]]