Back to Aurora Vision Library website

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

PathToPointDistance


Header: AVL.h
Namespace: avl
Module: FoundationBasic

Computes the smallest distance between a path and a point.

Syntax

C++
C#
 
void avl::PathToPointDistance
(
	const avl::Point2D& inPoint,
	const avl::Path& inPath,
	float inResolution,
	float& outDistance,
	atl::Optional<avl::Segment2D&> outConnectingSegment = atl::NIL
)

Parameters

Name Type Range Default Description
Input value inPoint const Point2D& Input point
Input value inPath const Path& Input path
Input value inResolution float 0.0 - 1.0f
Output value outDistance float& Minimal distance between input path and input point
Output value outConnectingSegment Optional<Segment2D&> NIL Segment connecting input path and input point 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.

Description

The operation computes the minimal distance between the inPoint and inPath and, additionally, the outConnectingSegment segment corresponding to the result.

Examples

The PathToPointDistance run on the sample data produces outDistance = 75.373.

Errors

List of possible exceptions:

Error type Description
DomainError Empty path on input in PathToPointDistance.

See Also

  • PathToPointDistanceProfile – Computes the profile of distances between the specified point and the characteristic points of a path.