Bug persisting in 11.3
I found RegionMember
quite useful in retrieving the condition for which a point $(x,y)$ belongs to a region. Thus, this command works:
RegionMember[Disk[{0, 0}, 3, {-\[Pi]/2, \[Pi]/4}]][{x, y}]
$$(x|y)\in \mathbb{R}\land x^2+y^2\leq 9\land \frac{x}{3}\geq 0\land -\frac{y}{3 \sqrt{2}}\geq -\frac{x}{3 \sqrt{2}}$$
However, it does not for this self-intersecting polygon:
RegionMember[Polygon[{{0, 0}, {1, 1}, {0, 1}, {1, 0}}]][{x, y}]
MMA returns
{}[{x, y}]
or
RegionMember[Polygon[{{0, 0}, {1, 1}, {0, 1}, {1, 0}}],{x, y}]
MMA returns the same:
RegionMember[Polygon[{{0, 0}, {1, 1}, {0, 1}, {1, 0}}], {x, y}]
Anyone could explain why RegionMember
fails in this case. The region seems to be not complicated.
RegionMember[Polygon[{{0, 0}, {1, 1}, {0, 1}, {1, 0}}]]
$\endgroup$DiscretizeRegion
to the polygon, then we get a region that works withRegionMember
. $\endgroup$RegionMember[RegionUnion@@Rationalize[Graphics`PolygonUtils`SimplePolygonPartition[Polygon[{{0,0},{1,1},{0,1},{1,0}}]]],{x,y}]
. $\endgroup$