You are here: Start » AVL.NET » AVL.PathToPathDistance(AvlNet.Path, AvlNet.Path, AvlNet.PathDistanceMode, float, float, AvlNet.Segment2D)

AVL.PathToPathDistance(AvlNet.Path, AvlNet.Path, AvlNet.PathDistanceMode, float, float, AvlNet.Segment2D)

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax


public static void PathToPathDistance(
	AvlNet.Path inPath1,
	AvlNet.Path inPath2,
	AvlNet.PathDistanceMode inPathDistanceMode,
	float inResolution,
	out float outDistance,
	out AvlNet.Segment2D outConnectingSegment
)

Parameters

inPath1
Type: AvlNet.Path
inPath2
Type: AvlNet.Path
inPathDistanceMode
Type: AvlNet.PathDistanceMode
inResolution
Type: System.Single
outDistance
Type: System.Single
outConnectingSegment
Type: AvlNet.Segment2D

Description

The operation finds the minimal distance between a characteristic point of inPath1 and path inPath2. The distance between a point and a path is computed as follows, depending on the value of inPathDistanceMode:

  • The distance to nearest characteristic point of inPath2, if inPathDistanceMode is set to PointToPoint.
  • The minimal distance to inPath2 segments adjacent to the nearest characteristic point of inPath2 (which is much more precise), if inPathDistanceMode is set to PointToSegment.

The operation computes the outDistance distance and, additionally, the outConnectingSegment line segment corresponding to the result.

Examples

The PathToPathDistance run on the sample paths produces outDistance = 9.509.

The resulting outConnectingSegment drawn onto the input paths.

Errors

Error type Description
DomainError One or both input paths are empty in PathToPathDistance.

See also