Message Boards Message Boards

0
|
3512 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Issue in RegionMember[ ] function?

I think there is potentially a bug in RegionMember function, particularly in the RegionMember[reg] form. Can you evaluate the example code below in other versions. I evaluated it in Mathematica 12.3.1 in Windows 10.

xLim = {0.`, 13.5`};
yLim = {0.2`, 15.65`};

\[ScriptCapitalD] = 
  Rectangle[{First@xLim, First@yLim}, {Last@xLim, Last@yLim}];

pt = {-1.64749633061814085218136846644477`8.*^-6, 4.3472396784343345644`8.};

RegionMember[\[ScriptCapitalD], pt]
(* False *)

regMem = RegionMember[\[ScriptCapitalD]];
regMem[pt]
(* True *)

The functional form of RegionMember is giving True whereas the normal operational form is giving False.

Also posted here @ : https://mathematica.stackexchange.com/questions/255890/problem-with-regionmember-function#255890

POSTED BY: Ali Hashmi
2 Replies

Very curious. I experimented with this behaviour and found a transition point where the operator form stops agreeing with the non-operator form:

Clear[pt];
pol = Polygon[{{{0, 0}, {10, 0},  {0., 10}}}];
pt[x_] := {-1.*10^(-x), 1};
Manipulate[
 {RegionMember[pol, pt[x]], RegionMember[pol][pt[x]]},
 {x, 5.77316, 5.7732}]

To keep safe, I would use exact polygons if possible.

POSTED BY: Gianluca Gorni

Thanks, Gianluca. Hopefully this issue gets fixed in the upcoming release!

POSTED BY: Ali Hashmi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract