You are here: Start » AVL.NET » Function Reference » Path » Path Features » AVL.PathDiameter

AVL.PathDiameter

Finds the longest segment connecting two characteristic points of a path.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void PathDiameter
(
	AvlNet.Path inPath,
	out AvlNet.Segment2D outDiameter,
	out float outDiameterLength
)

Parameters

Name Type Range Default Description
inPathAvlNet.PathInput path.
outDiameterAvlNet.Segment2D
outDiameterLengthfloat

Description

The operation finds the most distant pair of points within a path and returns the distance between them (outDiameterLength) and the segment representing the diameter (outDiameter). If there is more than one pair of maximal distance, the returned segment will correspond to one of them. The orientation of the resulting outDiameter is always between 0 and 180 degrees.

Examples

The resulting outDiameterLength = 280.0921, outDiameter segment was drawn onto the sample path.

Errors

List of possible exceptions:

Error type Description
DomainError Empty path on input in PathDiameter.

Function Overrides

See also