8

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?

  • 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. – tad Jun 15 '22 at 23:04
  • 2
    CylindricalDecomposition[0<x<2&&0<y<-2 x+4,{x,y},"Boundary"]//Simplify – chyanog Jun 16 '22 at 05:07
  • @chyanog Consider making your comment into an answer – MarcoB Jun 16 '22 at 12:51
  • I don't even get a RegionMemberFunction in MMA 12.0, I just get the expression returned unevaluated. – N.J.Evans Jun 16 '22 at 13:33

1 Answers1

8
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

chyanog
  • 15,542
  • 3
  • 40
  • 78