2
$\begingroup$

This code does what I expected: It displays the region of intersection between two disks:

Region[
 RegionIntersection[
  Disk[{0, 0}, 1],
  Disk[{3/2, 1/4}, 3/4]
  ]
 ]


          Lune


I expected this to do the same, but it does not:

R1 = Region[Disk[{0, 0}, 1]];
R2 = Region[Disk[{3/2, 1/4}, 3/4]];
Region[
 RegionIntersection[R1, R2]
 ]

It runs for a long time, and I've not had the patience to see if it ever displays the lune intersection.

Can anyone explain the difference?

Update. @HenrikSchumacher's comments showed that the problem is that there was a Region bug in version 11.1.1, which I was using, a bug fixed by version 11.3.

$\endgroup$
5
  • $\begingroup$ No explanation here. It executes quickly and returns the same result exactly as the first example in my copy of version 11.3 for macOS. But Mathematica cuts off the two tips. I guess, Region is meant to represent exact regions while the visual return of a Region is a coarse discritization solely meant for a quick preview. $\endgroup$ Jul 1, 2018 at 16:58
  • 1
    $\begingroup$ You can always convert to a MeshRegion or a BoundaryMeshRegion with customized resolution by DiscretizeRegion and BoundaryDiscretizeRegion. For example, the latter two have the option MaxCellMeasure that allows you to adjust how fine the discretization should be done. In total, all Region-related functionalities are rather new and a bit buggy; this is true in particular for BooleanRegion which is used under the hood (as you can see by inspecting FullForm[RegionIntersection[R1, R2]]). $\endgroup$ Jul 1, 2018 at 16:59
  • $\begingroup$ @HenrikSchumacher: Perhaps the difference is that I am using 11.1.1.0 MacOS. Time to update! $\endgroup$ Jul 1, 2018 at 17:46
  • $\begingroup$ @HenrikSchumacher: That was it---Works just as you describe in 11.3.0.0. Thanks! $\endgroup$ Jul 1, 2018 at 18:14
  • $\begingroup$ Glad to hear that! You're welcome. $\endgroup$ Jul 1, 2018 at 18:51

1 Answer 1

1
$\begingroup$
R1 = Region[Disk[{0, 0}, 1]];
R2 = Region[Disk[{3/2, 1/4}, 3/4]];
RegionPlot[RegionIntersection[R1, R2]]

works fine.

$\endgroup$

Your Answer

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

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