Back to FabImage Library website
You are here: Start » Function Reference » Geometry 2D Distance Metrics » PointToLineDistance
Header: | FIL.h |
---|---|
Namespace: | fil |
Measures the distance between a point and a line.
Syntax
C++
C#
void fil::PointToLineDistance ( const fil::Point2D& inPoint, const fil::Line2D& inLine, float inResolution, float& outDistance, ftl::Optional<fil::Segment2D&> outConnectingSegment = ftl::NIL, ftl::Optional<float&> outSignedDistance = ftl::NIL )
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 | ||
![]() |
outSignedDistance | Optional<float&> | NIL |
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::NIL
to these parameters: outConnectingSegment, outSignedDistance.
Read more about Optional Outputs.
Examples
![]() |
![]() |
PointToLineDistance performed on a sample point and a sample line. The green segment is the value of outConnectingSegment output.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Indefinite line on input in PointToLineDistance. |