Back to FabImage Library website
You are here: Start » Function Reference » Path » Path Metrics » PathToLineDistance

PathToLineDistance
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationBasic |
Computes the smallest distance between a path and a line.
Syntax
C++
C#
void fil::PathToLineDistance ( const fil::Path& inPath, const fil::Line2D& inLine, float inResolution, float& outDistance, ftl::Optional<fil::Segment2D&> outConnectingSegment = ftl::NIL )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inPath | const Path& | Input path | ||
![]() |
inLine | const Line2D& | Input line | ||
![]() |
inResolution | float | 0.0 - ![]() |
1.0f | Number of real-world units per one pixel |
![]() |
outDistance | float& | Minimal distance between input path and input line | ||
![]() |
outConnectingSegment | Optional<Segment2D&> | NIL | Segment connecting input path and input line having minimal length |
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::NIL
to these parameters: outConnectingSegment.
Read more about Optional Outputs.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Empty path on input in PathToLineDistance. |
DomainError | Indefinite line on input in PathToLineDistance. |