You are here: Start » AVL.NET » AVL.RegionDiameter(AvlNet.Region, AvlNet.Segment2D, float)

AVL.RegionDiameter(AvlNet.Region, AvlNet.Segment2D, float)

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax


public static void RegionDiameter(
	AvlNet.Region inRegion,
	out AvlNet.Segment2D outDiameter,
	out float outDiameterLength
)

Parameters

inRegion
Type: AvlNet.Region
outDiameter
Type: AvlNet.Segment2D
outDiameterLength
Type: System.Single

Description

The operation finds the most distant pair of region pixels 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 = 276.4815, outDiameter segment was drawn onto the region.

Errors

Error type Description
DomainError Empty region in RegionDiameter

See also