Back to Aurora Vision Library Lite website

You are here: Start » Geometry 2D » Geometry 2D Features » PointsDiameter

PointsDiameter


Header: AVL.h
Namespace: avl

Finds the longest segment connecting two points from a given array.

Syntax

void avl::PointsDiameter
(
	const atl::Array<avl::Point2D>& inPoints,
	atl::Optional<avl::Segment2D&> outDiameter = atl::NIL,
	atl::Optional<float&> outDiameterLength = atl::NIL
)

Parameters

Name Type Default Description
Input value inPoints const Array<Point2D>& Input array of points
Output value outDiameter Optional<Segment2D&> NIL Longest segment found
Output value outDiameterLength Optional<float&> NIL Length of longest segment found

Optional Outputs

The computation of following outputs can be switched off by passing value atl::NIL to these parameters: outDiameter, outDiameterLength.

Read more about Optional Outputs.

Examples

PointsDiameter performed on an array of input points. The orange line is the result.

Errors

List of possible exceptions:

Error type Description
DomainError Empty array of points on input in PointsDiameter.