Back to Adaptive Vision Library website
You are here: Start » Function Reference » Geometry 2D Distance Metrics » PointToSegmentDistance
PointToSegmentDistance
Measures the distance between a point and a segment.
Syntax
C++
C#
void avl::PointToSegmentDistance ( const avl::Point2D& inPoint, const avl::Segment2D& inSegment, atl::real inResolution, atl::real& outDistance, atl::Optional<avl::Segment2D&> outConnectingSegment = atl::NIL )
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inPoint | const Point2D& | |||
![]() |
inSegment | const Segment2D& | |||
![]() |
inResolution | real | 0.0 - ![]() |
1.0f | Number of real-world units per one pixel |
![]() |
outDistance | real& | |||
![]() |
outConnectingSegment | Optional<Segment2D&> | NIL |
Examples
![]() |
![]() |
PointToSegmentDistance performed on a sample point and a sample segment. The green segment is the value of outConnectingSegment output.





