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)
Computes the minimum distance between two paths.
| 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
First input path - inPath2
- Type: AvlNet.Path
Second input path - inPathDistanceMode
- Type: AvlNet.PathDistanceMode
Distance measuring method - inResolution
- Type: System.Single
- outDistance
- Type: System.Single
Minimal distance between input paths - 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. |


