RegionDistanceFunction[reg,…]
represents a function whose values give the distance from a point to the region reg.


RegionDistanceFunction
RegionDistanceFunction[reg,…]
represents a function whose values give the distance from a point to the region reg.
Details

- RegionDistanceFunction is also known as distance function, distance transform, signed distance function and signed distance transform.
- RegionDistanceFunction works like Function.
- RegionDistanceFunction is generated by RegionDistance[reg] or SignedRegionDistance[reg].
- If generated by RegionDistance, RegionDistanceFunction[reg,…][p] gives RegionDistance[reg,p].
- If generated by SignedRegionDistance, RegionDistanceFunction[reg,…][p] gives SignedRegionDistance[reg,p].
Examples
open all close allBasic Examples (1)
Scope (17)
Special Regions (8)
Point sets:
Plot the distance from a three-point set:
Line:
Rectangle can be used in 2D:
Cuboid generalizes it to any dimension:
Equidistance surfaces of a cuboid in 3D:
Simplex can be used in any dimension:
Plot the distance to a 2D simplex:
Disk can be used in 2D:
Ball generalizes a disk to any dimension:
Disk can be an ellipse in 2D:
Ellipsoid generalizes this to any dimension:
Plot the distance to an ellipse:
Circle can be elliptical:
Formula Regions (2)
The distance to a disk represented as an ImplicitRegion:
The distance to a disk represented as a ParametricRegion:
Mesh Regions (4)
The distance to a 1D BoundaryMeshRegion:
The distance to a 0D MeshRegion in 1D:
The distance to a 0D MeshRegion in 2D:
A 0D MeshRegion in 3D:
Derived Regions (3)
The distance to a RegionIntersection:
The distance to a TransformedRegion:
The distance to a RegionBoundary:
Applications (3)
Properties & Relations (1)
RegionDistanceFunction gives the same value when applied to a point as RegionDistance:
Related Guides
History
Text
Wolfram Research (2014), RegionDistanceFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/RegionDistanceFunction.html.
CMS
Wolfram Language. 2014. "RegionDistanceFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RegionDistanceFunction.html.
APA
Wolfram Language. (2014). RegionDistanceFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RegionDistanceFunction.html
BibTeX
@misc{reference.wolfram_2025_regiondistancefunction, author="Wolfram Research", title="{RegionDistanceFunction}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/RegionDistanceFunction.html}", note=[Accessed: 10-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_regiondistancefunction, organization={Wolfram Research}, title={RegionDistanceFunction}, year={2014}, url={https://reference.wolfram.com/language/ref/RegionDistanceFunction.html}, note=[Accessed: 10-August-2025]}