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.

Details

Examples

open allclose all

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[4]:=
Click for copyable input
Out[4]=

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]=

Scope  (17)

Applications  (2)

Properties & Relations  (5)

See Also

RegionDistanceFunction  RegionDistance  RegionNearest  Norm  MinValue  NMinValue

Introduced in 2014
(10.0)