WOLFRAM

gives the Hausdorff distance between the regions reg1 and reg2.

Details and Options

  • RegionHausdorffDistance is also known as Hausdorff metric and PompeiuHausdorff distance.
  • The Hausdorff distance measures how different two regions are from each other.
  • RegionHausdorffDistance is the greatest of all distances from a point in one region to the closest point in the other region.
  • The distance between points p and q is taken to be Norm[p-q].
  • RegionHausdorffDistance is effectively given by the maximum of MaxValue[MinValue[Norm[p-q],qreg2],preg1] and MaxValue[MinValue[Norm[p-q],qreg1],preg2].
  • Unless the regions are closed, the Hausdorff distance may not be attained by points in the region but in the closure of the regions.
  • The Hausdorff distance between two regions reg1 and reg2 is ϵ if reg1RegionDilation[reg2,ϵ] and reg2RegionDilation[reg1,ϵ].

Examples

open allclose all

Basic Examples  (4)Summary of the most common use cases

Find the Hausdorff distance between two disks:

Out[20]=20

Show the disks:

Out[21]=21

Find the Hausdorff distance between the unit disk and a regular polygon:

Out[1]=1

Show the regions:

Out[2]=2

Plot the Hausdorff distance as the number of sides increases:

Out[3]=3

Find the Hausdorff distance between two point clouds:

Out[1]=1

Find the Hausdorff distance between a MeshRegion and its convex hull:

Out[2]=2

Show the hull:

Out[3]=3

Scope  (9)Survey of the scope of standard use cases

Special Regions  (8)

Points:

Out[1]=1

RegionHausdorffDistance accepts coordinate lists:

Out[2]=2

Lines:

Out[1]=1
Out[2]=2

Polygons:

Out[1]=1
Out[2]=2

Simplices:

Out[1]=1
Out[2]=2
Out[3]=3

Boxes:

Out[1]=1
Out[2]=2
Out[3]=3

Balls:

Out[1]=1
Out[2]=2

Spheres:

Out[1]=1
Out[2]=2

Regions in n:

Out[1]=1
Out[2]=2
Out[3]=3
Out[4]=4

Mesh Regions  (1)

The Hausdorff distance between two 1D meshes:

Out[10]=10

2D:

Out[192]=192
Out[193]=193

3D:

Out[207]=207
Out[147]=147

Options  (2)Common values & functionality for each option

WorkingPrecision  (2)

RegionHausdorffDistance will try to compute the distance using the same precision as its inputs:

Out[1]=1

Compute the distance using machine arithmetic:

Out[2]=2

In some cases, the exact answer cannot be computed:

Out[3]=3

Find the RegionHausdorffDistance using 30 digits of precision:

Out[1]=1

Applications  (1)Sample problems that can be solved with this function

Region Reconstruction  (1)

Reconstruct a mesh from random point samples:

Determine the Hausdorff distance between the ground truth and reconstructed mesh:

Out[2]=2

Plot how the Hausdorff distance decreases with larger sample counts:

Out[3]=3

Properties & Relations  (4)Properties of the function, and connections to other functions

The Hausdorff distance between two points is equivalent to the EuclideanDistance:

Out[3]=3
Out[2]=2

The Hausdorff distance between two point sets is the maximum EuclideanDistance from any point to the other set:

Out[2]=2

The Hausdorff distance between a region and a single point is the furthest distance of the point to any point in the region:

Out[1]=1

RegionDistance can be used to find the nearest distance from a point to a region:

Out[2]=2
Wolfram Research (2023), RegionHausdorffDistance, Wolfram Language function, https://reference.wolfram.com/language/ref/RegionHausdorffDistance.html.
Wolfram Research (2023), RegionHausdorffDistance, Wolfram Language function, https://reference.wolfram.com/language/ref/RegionHausdorffDistance.html.

Text

Wolfram Research (2023), RegionHausdorffDistance, Wolfram Language function, https://reference.wolfram.com/language/ref/RegionHausdorffDistance.html.

Wolfram Research (2023), RegionHausdorffDistance, Wolfram Language function, https://reference.wolfram.com/language/ref/RegionHausdorffDistance.html.

CMS

Wolfram Language. 2023. "RegionHausdorffDistance." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RegionHausdorffDistance.html.

Wolfram Language. 2023. "RegionHausdorffDistance." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RegionHausdorffDistance.html.

APA

Wolfram Language. (2023). RegionHausdorffDistance. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RegionHausdorffDistance.html

Wolfram Language. (2023). RegionHausdorffDistance. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RegionHausdorffDistance.html

BibTeX

@misc{reference.wolfram_2025_regionhausdorffdistance, author="Wolfram Research", title="{RegionHausdorffDistance}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/RegionHausdorffDistance.html}", note=[Accessed: 24-April-2025 ]}

@misc{reference.wolfram_2025_regionhausdorffdistance, author="Wolfram Research", title="{RegionHausdorffDistance}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/RegionHausdorffDistance.html}", note=[Accessed: 24-April-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_regionhausdorffdistance, organization={Wolfram Research}, title={RegionHausdorffDistance}, year={2023}, url={https://reference.wolfram.com/language/ref/RegionHausdorffDistance.html}, note=[Accessed: 24-April-2025 ]}

@online{reference.wolfram_2025_regionhausdorffdistance, organization={Wolfram Research}, title={RegionHausdorffDistance}, year={2023}, url={https://reference.wolfram.com/language/ref/RegionHausdorffDistance.html}, note=[Accessed: 24-April-2025 ]}