You are here: Start » AVL.NET » Function Reference » Region » Region Metrics » AVL.RegionToRegionDistance

AVL.RegionToRegionDistance

Computes minimal distance between one of the points of the first region with one of the points of the second region.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void RegionToRegionDistance
(
	AvlNet.Region inRegion1,
	AvlNet.Region inRegion2,
	float inResolution,
	out float outDistance,
	NullableValue<AvlNet.Segment2D> outConnectingSegment
)

Parameters

Name Type Range Default Description
inRegion1AvlNet.RegionFirst input region.
inRegion2AvlNet.RegionSecond input region.
inResolutionfloat<0.0f, INF>1.0fNumber of real-world units per one pixel. Default value: 1.0f.
outDistancefloat
outConnectingSegmentAvlNet.NullableValue<AvlNet.Segment2D> Can be null to skip this parameter calculation.

Description

Operation computes length of the shortest segment that connects center of one of inRegion1's point which center of one of inRegion2's point.

Examples

RegionToRegionDistance performed on sample regions produced outDistance = 118,5116. The shortest segment connecting regions is presented on the bottom image

Remarks

  • inRegion1 and inRegion2 must not be empty, otherwise an error with appropriate description occurs.

Errors

List of possible exceptions:

Error type Description
DomainError Empty region on input in RegionToRegionDistance.

Function Overrides

See also