Back to Adaptive Vision Library website

You are here: Start » Function Reference » Path » Path Metrics » PathToLineDistance

PathToLineDistance


Header: AVL.h
Namespace: avl
Module: FoundationBasic

Computes the smallest distance between a path and a line.

Syntax

C++
C#
 
void avl::PathToLineDistance
(
	const avl::Path& inPath,
	const avl::Line2D& inLine,
	float inResolution,
	float& outDistance,
	atl::Optional<avl::Segment2D&> outConnectingSegment = atl::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 atl::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.