SignedRegionDistance

SignedRegionDistance[reg,p]
gives the minimum distance from the point p to the region reg if p is outside the region and the minimum distance to the complement of reg if p is inside the region.

SignedRegionDistance[reg]
gives a RegionDistanceFunction[] that can be applied repeatedly to different points.

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Find the signed distance from a point inside to the unit disk:

In[1]:=
Click for copyable input
Out[1]=

For a point outside:

In[2]:=
Click for copyable input
Out[2]=

Plot the distance as a function of position:

In[1]:=
Click for copyable input
Out[1]=

Find the signed distance from a point to a MeshRegion:

In[1]:=
Click for copyable input
Out[1]=

With one argument, you get a RegionDistanceFunction:

In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=
Introduced in 2014
(10.0)