8
$\begingroup$

This is my first question on this forum, but by no means my first problem with Mathematica (which I've been using daily for years).

Consider

Clear[x, y]
reg = RegionBoundary[ImplicitRegion[0 < x < 2 \[And] 0 < y < -2 x + 4, {x, y}]];

In Mathematica 10.3, the expression

RegionMember[reg, {x, y}]

evaluates to the following logical condition

(x | y) \[Element] Reals && ((x == 0 && 
 0 <= y <= 4) || (0 < x < 2 && (y == 0 || y == 4 - 2 x)) || (x == 
  2 && y == 0))

which is correct. However, since version 12 (at least) the result is not a symbolic condition anymore, but a RegionMemberFunction expression.

How can one get the predicate above or something equivalent?

$\endgroup$
4
  • $\begingroup$ RegionMember gives logical condition for implicit regions, so I thought to try RegionConvert[reg,"Implicit"]. But that doesn't evaluate. Alternatively, first converting to mesh with Chop[RegionConvert[DiscretizeRegion[reg], "Implicit"]] gives the full region, not the boundary. $\endgroup$
    – tad
    Commented Jun 15, 2022 at 23:04
  • 2
    $\begingroup$ CylindricalDecomposition[0<x<2&&0<y<-2 x+4,{x,y},"Boundary"]//Simplify $\endgroup$
    – chyanog
    Commented Jun 16, 2022 at 5:07
  • $\begingroup$ @chyanog Consider making your comment into an answer $\endgroup$
    – MarcoB
    Commented Jun 16, 2022 at 12:51
  • $\begingroup$ I don't even get a RegionMemberFunction in MMA 12.0, I just get the expression returned unevaluated. $\endgroup$
    – N.J.Evans
    Commented Jun 16, 2022 at 13:33

1 Answer 1

8
$\begingroup$
cond = CylindricalDecomposition[0 < x < 2 && 0 < y < -2 x + 4, {x, y}, "Boundary"
  ] // Simplify

(x == 0 && y >= 0 && 2 x + y <= 4) || (0 <= x && ((y == 0 && x <= 2) || (2 x + y == 4 && x < 2)))

RegionPlot[ImplicitRegion[cond, {x, y}], Frame -> False]

enter image description here

$\endgroup$
2
  • $\begingroup$ chyanog, thank you very much for the answer, especially for bringing attention to CylindricalDecomposition and its topological powers acquired in version 11.2 (which I had forgotten about!). $\endgroup$ Commented Jun 16, 2022 at 21:56
  • $\begingroup$ @GregosTroianosEducacional It’s my pleasure. $\endgroup$
    – chyanog
    Commented Jun 17, 2022 at 4:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.