Back to Adaptive Vision Library websiteYou are here:
Start »
Function Reference »
Geometry 2D Distance Metrics »
PointToLineDistance
Measures the distance between a point and a line.
Syntax
C++
C#
void avl::PointToLineDistance
(
const avl::Point2D& inPoint,
const avl::Line2D& inLine,
float inResolution,
float& outDistance,
atl::Optional<avl::Segment2D&> outConnectingSegment = atl::NIL
)
void PointToLineDistance
(
Point2D inPoint,
Line2D inLine,
float inResolution,
out float outDistance,
out Segment2D? outConnectingSegment
)
Parameters
|
Name |
Type |
Range |
Default |
Description |
|
inPoint |
const Point2D& |
|
|
|
|
inLine |
const Line2D& |
|
|
|
|
inResolution |
float |
0.0 - |
1.0f |
Number of real-world units per one pixel |
|
outDistance |
float& |
|
|
|
|
outConnectingSegment |
Optional<Segment2D&> |
|
NIL |
|
Examples
PointToLineDistance performed on a sample point and a sample line. The green segment is the value of outConnectingSegment output.
Errors
Error type |
Description |
DomainError |
Indefinite line on input in PointToLineDistance. |