From 12:00 AM CDT Sunday, October 17 - 11:30 AM CDT Sunday, October 17, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

# Fit Circle (G Dataflow)

Finds the circle that best represents a set of points and returns the radius, perimeter, and area of the circle.

This node requires a minimum of three points. The resulting circle may take into account only a subset of the points you provide.  Array of point-coordinate clusters that correspond to points on the circumference of the circle.

This array must contain three or more point-coordinate clusters. ## minimum score

Required quality of the fitted circle.

The score can vary from 0 to 1000, where 1000 represents a perfect circle.

Default: 500 ## maximum iterations

Maximum number of refining steps the algorithm takes to ensure that the quality of the fit is better than minimum score.

maximum iterations is valid only when reject outliers is TRUE. ## reject outliers

Boolean that specifies if every given radial point is used or only a subset of the points to fit the circle.

 True Algorithm determines the best subset of points to use and ignores the points outside the subset. False Algorithm uses every given point.

Default: False ## error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error  If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error Acceptable distance, in pixels, that a point determined to belong to the circle can be from the perimeter of the circle. ## circle

Cluster of data from center and radius. ### center

Coordinates of the center of the circle.  ## measurements

Cluster of data from area and perimeter. ### area

Area of the circle. ### perimeter

Perimeter of the circle. ## residual

Least square error of the fitted circle over every given radial point.

Residual = where e i represents the distance from the i th input point to the perimeter of the circle. ## valid fit?

Boolean that indicates if the fit is valid.

This indicator is TRUE if the quality of the fit is better than minimum score and the fit was attained within maximum iterations. valid fit? is a function of minimum score, maximum iterations, and pixel radius. ## error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error  If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out. ## indexes of points used

Array that returns the indexes of points in the radial points array that were used to fit the circle.

Some points may be excluded based on the minimum score, pixel radius, or reject outliers specified.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application