Back to Adaptive Vision Library websiteYou are here:
Start »
Function Reference »
Path Metrics »
PathToPointDistance
Computes the smallest distance between a path and a point.
Syntax
C++
C#
void avl::PathToPointDistance
(
const avl::Point2D& inPoint,
const avl::Path& inPath,
float inResolution,
float& outDistance,
atl::Optional<avl::Segment2D&> outConnectingSegment = atl::NIL
)
void PathToPointDistance
(
Point2D inPoint,
Path inPath,
float inResolution,
out float outDistance,
out Segment2D? outConnectingSegment
)
Parameters
|
Name |
Type |
Range |
Default |
Description |
|
inPoint |
const Point2D& |
|
|
Input point |
|
inPath |
const Path& |
|
|
Input path |
|
inResolution |
float |
0.0 - |
1.0f |
|
|
outDistance |
float& |
|
|
Minimal distance between input path and input point |
|
outConnectingSegment |
Optional<Segment2D&> |
|
NIL |
Segment connecting input path and input point having minimal length |
Description
The operation computes the minimal distance between the inPoint and inPath and, additionally, the outConnectingSegment segment corresponding to the result.
Examples
The PathToPointDistance run on the sample data produces outDistance = 75.373.
Errors
Error type |
Description |
DomainError |
Empty path on input in PathToPointDistance. |
See Also
- PathToPointDistanceProfile – Computes the profile of distances between the specified point and the characteristic points of a path.