I can get the region of a disk $\{x,y\}\in\{x^2+y^2 \leq 1\}$ as follows:
Region[Disk[]]
Now my question is: Is there also an automated way to get the perimeter region ?
$$\{x,y\}\in\{x^2+y^2=1\}$$
Many thanks !
Update: Composing RegionMember
, RegionBoundary
and FullSimplify
:
ClearAll[boundaryRF]
boundaryRF = FullSimplify[RegionMember[RegionBoundary @ #, #2], #2 ∈ Reals] &;
Examples:
Grid[{#, boundaryRF[#, {x, y}]} & /@
{Disk[], Disk[{a, b}, r], Rectangle[], Triangle[]},
Dividers -> All]
Grid[{#, boundaryRF[#, {x, y, z}]} & /@
{Ball[], Ball[{a, b, c}, r], Tetrahedron[], Cone[]},
Dividers -> All]
For Disk
yes:
RegionBoundary[Disk[]]
Circle[{0, 0}]
RegionMember[%, {x, y}]
(x | y) ∈ Reals && x^2 + y^2 == 1
Works with symbolic parameters too:
RegionBoundary[Disk[{a, b}, r]]
Circle[{a, b}, r]
RegionMember[%, {x, y}]
(x | y) ∈ Reals && r > 0 && (-a + x)^2 + (-b + y)^2 == r^2
... and few other primitives:
RegionBoundary[Ball[]]
Sphere[{0, 0, 0}]
RegionMember[%, {x, y, z}]
(x | y | z) ∈ Reals && x^2 + y^2 + z^2 == 1
RegionBoundary[Rectangle[]]
Line[{{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0, 0}}]
RegionMember[%, {x, y}] // FullSimplify
(x | y) ∈ Reals && ((0 <= y <= 1 && (x == 0 || x == 1)) || (0 <= x <= 1 && (y == 0 || y == 1)))
Acknowledgement: Thank you Chip Hurst for reminding me that we can use RegionMember
instead of
Region`RegionProperty[%, {x, y}, "FastDescription"][[1, -1]]
to get the region function.
Region`RegionProperty[...
what does the `
stand for ?
$\endgroup$
RegionMember[RegionBoundary[Disk[]], {x, y}]
?
$\endgroup$
Commented
Apr 6, 2020 at 12:19
RegionBoundary[Region[Disk[]]]
? $\endgroup$