CircleFromNPoints

Fits a circle using three or more input points.

CircleFromNPoints Inputs

Syntax: CircleFromNPoints(Point Row 0,Point Col 0,Point Row 1,Point Col 1,Point Row 2,Point Col 2,...,Point Row N,Point Col N,Show)

Parameter Description

Point 0

Specifies the coordinates of the first point.

Point Row 0

The x-coordinate of the first point.

Point Col 0

The y-coordinate of the first point.

Point 1

Specifies the coordinates of the second point.

Point Row 1

The x-coordinate of the second point.

Point Col 1

The y-coordinate of the second point.

Point 2

Specifies the coordinates of the third point.

Point Row 2

The x-coordinate of the third point.

Point Col 2

The y-coordinate of the third point.

Point 3..N

Optionally specifies the coordinates of any additional points.

Point Row N

The x-coordinate of the Nth point.

Point Col N

The y-coordinate of the Nth point.

Show

Specifies the graphics items to be displayed on a permanent basis.

0 = hide all

All graphics items will be hidden except when the cell containing the CircleFromNPoints function is the active cell in the spreadsheet.

1 = result graphics only

The fitted circle graphic will be displayed at all times. The input points will only be displayed when the cell containing the CircleFromNPoints function is the active cell in the spreadsheet.

2 = input and result graphics

The fitted circle and the input points will be displayed at all times.

CircleFromNPoints Outputs

Returns

A CircleFit data structure containing the row, column, radius and sigma of the fitted circle.

Results

When the function is initially inserted into a cell, a result table is created in the spreadsheet.

CircleFromNPoints Vision Data Access Functions

The following Vision Data Access functions are automatically inserted into the spreadsheet to create the result table. For more information, see CircleFit.

Row

GetRow(CircleFit)

The x-coordinate of the center of the circle.

Col

GetCol(CircleFit)

The y-coordinate of the center of the circle.

Radius

GetRadius(CircleFit)

The radius of the circle.

Sigma

GetSigma(CircleFit)

The square root of the sum of the squares of the distances from the points to the circle divided by the number of points.

Additional data elements can be accessed using the following Vision Data Access functions:

Distance

GetDistance(CircleFit, Index)

The distance between the indexed point and the circle. If the value is negative, the point is within the circle. If the indexed point is invalid, an #ERR is returned.

MaxDist

GetMaxDist(CircleFit)

The distance between the circle and the point farthest from the circle. If the value is negative, the point is within the circle.

MaxDistIndex

GetMaxDistIndex(CircleFit)

The index of the point farthest from the circle.

NPointsUsed

GetNPointsUsed(CircleFit)

The number of points used to fit the circle.