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.
Please visit the official Wolfram Language Reference for more details and examples on core symbols.