Back to FabImage Library website
You are here: Start » Function Reference » Geometry 2D » Geometry 2D Features » PointsDiameter
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationLite |
Finds the longest segment connecting two points from a given array.
Syntax
C++
C#
void fil::PointsDiameter ( const ftl::Array<fil::Point2D>& inPoints, ftl::Optional<fil::Segment2D&> outDiameter = ftl::NIL, ftl::Optional<float&> outDiameterLength = ftl::NIL )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
inPoints | const Array<Point2D>& | Input array of points | |
![]() |
outDiameter | Optional<Segment2D&> | NIL | Longest segment found |
![]() |
outDiameterLength | Optional<float&> | NIL | Length of longest segment found |
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::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. |