Skip to content

SignedRegionDistance

Like RegionDistance, but negative for points inside a solid region.

$ wo 'SignedRegionDistance[Disk[{0, 0}, 1], {3, 0}]'
2
$ wo 'SignedRegionDistance[Disk[{0, 0}, 1], {0, 0}]'
-1

A Rectangle gives the signed axis-aligned-box distance.

$ wo 'SignedRegionDistance[Rectangle[{0, 0}, {4, 2}], {1, 1}]'
-1