MinimumZoneCircle (FPScript)

21.09.2021

Calculates the reference circles of the minimum zone (MZCI) of a two-dimensional point set. Used to determine roundness.

Syntax

MinimumZoneCircle(Points, [ OutputOptions = MZCI_OUTPUT_INSCRIBED_CIRCLE + MZCI_OUTPUT_CIRCUMSCRIBED_CIRCLE ], [ CircleSize = 5000 ], [ Iterations ] [ , StepWidth ])
or
MinimumZoneCircle(Y, X, [ OutputOptions = MZCI_OUTPUT_INSCRIBED_CIRCLE + MZCI_OUTPUT_CIRCUMSCRIBED_CIRCLE ], [ CircleSize = 5000 ], [ Iterations ] [ , StepWidth ])

 

The syntax of the MinimumZoneCircle function consists of the following parts:

Part

Description

Points

The Y and X point sets for which the minimum zone concentric reference circles are to be calculated. The same unit must be used for both components of the signal.

Permitted data structures are signal. All real data types are permitted, except calendar time und time span.

Y

The Y points used to calculate the minimum zone concentric reference circles. If you specify a signal, its Y component is used. The unit must match the unit of the X argument.

Permitted data structures are data series und signal. All real data types are permitted, except calendar time und time span.

X

The X points used to calculate the minimum zone concentric reference circles. If you specify a signal, its Y component is used. The unit must match the unit of the Y argument.

Permitted data structures are data series und signal. All real data types are permitted, except calendar time und time span.

OutputOptions

Specifies which results are to be returned. Multiple results are output as a list. If, for instance, the radius of the arithmetic center circle and the roundness are to be output, the argument must contain the value MZCI_OUTPUT_MIDDLE_CIRCLE_RADIUS + MCCI_OUTPUT_ROUNDNESS.

The argument OutputOptions can have the following values:

Constant

Meaning

+ MZCI_OUTPUT_ALL

All available output.

+ MZCI_OUTPUT_CENTER_X

X coordinate of the concentric reference circles. The result is a 64-bit floating point value.

+ MZCI_OUTPUT_CENTER_Y

Y coordinate of the concentric reference circles. The result is a 64-bit floating point value.

+ MZCI_OUTPUT_MIDDLE_CIRCLE

The arithmetically averaged circle between the concentric reference circles, i.e. the minimum circumscribed circle and the maximum inscribed circle. The result is a signal.

+ MZCI_OUTPUT_MIDDLE_CIRCLE_RADIUS

Radius of the arithmetically averaged circle. The result is a 64-bit floating point value.

+ MZCI_OUTPUT_INSCRIBED_CIRCLE

The calculated inscribed circle (reference circle). The center of the inscribed circle is equal to the center of the circumscribed circle (second reference circle). The result is a signal.

+ MZCI_OUTPUT_INSCRIBED_CIRCLE_RADIUS

Radius of the inscribed circle. The result is a 64-bit floating point value.

+ MZCI_OUTPUT_CIRCUMSCRIBED_CIRCLE

The calculated circumscribed circle (reference circle). The center of the inscribed circle is equal to the center of the inscribed circle (second reference circle). The result is a signal.

+ MZCI_OUTPUT_CIRCUMSCRIBED_CIRCLE_RADIUS

Radius of the circumscribed circle. The result is a 64-bit floating point value.

+ MZCI_OUTPUT_ROUNDNESS

The roundness deviation. Is the difference between the radii of the circumscribed and inscribed circles. The result is a 64-bit floating point value.

If this argument is omitted, it will be set to the default value MZCI_OUTPUT_INSCRIBED_CIRCLE + MZCI_OUTPUT_CIRCUMSCRIBED_CIRCLE.

CircleSize

Specifies the number of values used to represent the fitted circles. If you enter zero, the original number of values are retained. The argument is considered only if one of the listed circles was selected for OutputOptions.

Permitted data structures are scalar value. All integral data types are permitted.

The value must be greater or equal to 0.

If this argument is omitted, it will be set to the default value 5000.

Iterations

Number of iterations for calculating the concentric reference circles with the minimum possible radius difference, i.e. the minimum possible roundness deviation. If you omit this argument, the number of iterations is set to an automatic value (dependent on the size of the input data sets). The larger the number of iterations, the more precise the result (but the calculation also takes longer).

Permitted data structures are scalar value. All integral data types are permitted.

The value must be greater or equal to 1.

StepWidth

Increment for the iterative calculation of the concentric reference circles with the minimum possible radius difference, i.e. the minimum possible roundness deviation. If you omit this argument, the increment is set to an automatic value (dependent on the input data sets).

Permitted data structures are scalar value. Supported data types are 64-bit floating point.

The value must be greater than 0.

Remarks

The values are converted to 64-bit floating points before the calculation is made.

The minimum zone concentric reference circles (MZCI) are estimated during the first iteration step by the inscribed and circumscribed circles calculated by the least squares circle (LSCI). The result is then improved iteratively. A new point is randomly selected around the center point of the current concentric inscribed and circumscribed circles with the help of a two-dimensional normal distribution (standard deviation corresponds to the StepWidth argument). It is checked whether the concentric inscribed and circumscribed circles recalculated to the new point have a smaller radius difference than before. If they do, the point becomes the new center point. The procedure is repeated iteratively N times according to the value of the argument Iterations. The iterative procedure converges toward the concentric reference circles with the minimum possible radius difference, i.e. toward the minimum zone reference circles. The larger the number of iterations, the more precise the result. This algorithm is a Monte Carlo method.

The output options of the argument OutputOptions are visualized in the following diagram:

The results can be accessed using the following list element names:

Constant

Meaning

.["Center_X"]

X coordinate of the center of the concentric reference circles.

.["Center_Y"]

Y coordinate of the center of the concentric reference circles.

.["Middle_Circle"]

The arithmetically averaged circle between the concentric reference circles.

.["Middle_Circle_Radius"]

Radius of the arithmetically averaged circles.

.["Inscribed_Circle"]

The inscribed circle (reference circle).

.["Inscribed_Circle_Radius"]

Radius of the inscribed circle.

.["Circumscribed_Circle"]

The circumscribed circle (reference circle).

.["Circumscribed_Circle_Radius"]

Radius of the circumscribed circle.

.["Roundness"]

Roundness deviation as the difference between the radii of the circumscribed and inscribed circles.

You can also always use the Formula.Listelementname syntax.

Note        The MICI roundness calculations are based on the currently valid standard for for determining roundness; see [1].

Available in

FlexPro Professional, Developer Suite

Examples

MinimumZoneCircle(y, x)

Calculates the MZCI reference circles of a point set.

MinimumZoneCircle(y, x, MZCI_OUTPUT_ROUNDNESS)

Calculates the MZCI circles of a point set and returns only the roundness.

MinimumZoneCircle(points, MZCI_OUTPUT_MIDDLE_CIRCLE_RADIUS + MZCI_OUTPUT_ROUNDNESS)

Calculates the MZCI circles of a point set. As the result, the radius of the center circle and the roundness are output as a list.

Dim alpha = Series(0, 2*PI, 0.05)
Dim r = 11.5 + Noise(1 # NumberOfRows(alpha), NOISE_NORMAL)
Dim points = Signal(Noise(1) + r*Sin(alpha), Noise(1) + r*Cos(alpha))
List("Points", points, "Minimum Zone Circle", MinimumZoneCircle(points))

Calculates the MZCI circles of randomly distributed points in the two-dimensional plane.

See Also

LeastSquaresCircle Function

MaximumInscribedCircle Function

MinimumCircumscribedCircle Function

GaussianFilter Function

NonLinCurveFit Function

Approximation Function

Circle Approximation - Analysis Object

References

[1] DIN Deutsches Institut für Normung e.V.: Part 1: Vocabulary and parameters of roundness (ISO 12181-1:2011); English translation of DIN EN ISO 12181-1:2011. In: Geometrical product specifications (GPS)- Roundness. 2011.

Share article or send as email:

You might be interested in these articles