Back to FabImage Library website

You are here: Start » Function Reference » Geometry 2D » Geometry 2D Fitting » FitArcToPoints

FitArcToPoints


Header: FIL.h
Namespace: fil
Module: FoundationBasic

Approximates points with an arc using the selected outliers suppression method.

Syntax

C++
C#
 
void fil::FitArcToPoints
(
	const ftl::Array<fil::Point2D>& inPoints,
	ftl::Optional<const fil::Range&> inRange,
	fil::CircleFittingMethod::Type inFittingMethod,
	ftl::Optional<fil::MEstimator::Type> inOutlierSuppression,
	ftl::Conditional<fil::Arc2D>& outArc,
	ftl::Optional<ftl::Array<fil::Point2D>&> outInliers = ftl::NIL
)

Parameters

Name Type Default Description
Input value
inPoints const Array<Point2D>&
Input value
inRange Optional<const Range&> NIL Determines which array points take part in fitting process
Input value
inFittingMethod CircleFittingMethod::Type
Input value
inOutlierSuppression Optional<MEstimator::Type> NIL
Output value
outArc Conditional<Arc2D>& Fitted arc or nothing if the computations failed to converge
Output value
outInliers Optional<Array<Point2D>&> NIL Points matching the fitting arc

Optional Outputs

The computation of following outputs can be switched off by passing value ftl::NIL to these parameters: outInliers.

Read more about Optional Outputs.

Examples

The resulting outArc drawn with the input points, inFittingMethod = AlgebraicKasa and inOutlierSuppression = Auto.

Errors

List of possible exceptions:

Error type Description
DomainError Outlier suppression is supported only in algebraic fitting methods.
DomainError Range exceeds the input point array in FitArcToPoints.