# CircleToCircle

Computes the minimum distance between two circles.

Note: The distance is positive if circles are separated, 0.0 if intersecting and negative if one circle is inside the other.
Inputs

The CircleToCircle function Functions are tools that are available in Spreadsheet for processing and analyzing acquisitions or other results. You can add functions to your Spreadsheet job to create tool chains and produce results for specific applications. has the following syntax:

CircleToCircle(Image, X, Y, Radius, X, Y, Radius, Show)

See the table for a description of the available parameters.

Parameter | Description
Image | This argument must reference a spreadsheet cell that contains a valid Image data structure. By default, the cell referenced is cell A0, containing the AcquireImage function.
Circle 0 | Specifies the coordinates and size of the first circle.
X | The X coordinate of the center of the first circle.
Y | The Y coordinate of the center of the first circle.
Radius | The radius of the first circle, in pixels.
Circle 1 | Specifies the coordinates and size of the second circle.
X | The X coordinate of the center of the second circle.
Y | The Y coordinate of the center of the second circle.
Radius | The radius of the second circle, in pixels.
Show | Specifies the display mode for the graphical overlays of the function on top of the image.
0 = hide all (default) | All graphics are hidden, except when the cell containing the function is highlighted in the spreadsheet.
1 = result graphics only | A line segment showing the minimum distance between the two circles will be displayed at all times.
2 = input and result graphics | The two circles and the line segment between them are displayed at all times.

Outputs

Returns | A Dist data structure containing a point on the first circle, a point on the second circle, the distance between points, and the angle of the directed distance.
Results | When the function is initially inserted into a cell, a result table is created in the spreadsheet. The following Dist Vision Data Access functions are automatically inserted into the spreadsheet to create the result table:
Label | Function | Description
X0 | GetX(Dist, 0) | If not intersecting, the X coordinate of a point on the first circle. If intersecting, the X coordinate of the first point of intersection.
Y0 | GetY(Dist, 0) | If not intersecting, the Y coordinate of a point on the first circle. If intersecting, the Y coordinate of the first point of intersection.
X1 | GetX(Dist, 1) | If not intersecting, the X coordinate of a point on the second circle. If intersecting, the X coordinate of the second point of intersection.
Y1 | GetY(Dist, 1) | If not intersecting, the Y coordinate of a point on the second circle. If intersecting, the Y coordinate of the second point of intersection.
Angle | GetAngle(Dist) | The point-to-point angle.
Distance | GetDistance(Dist) | If not intersecting, the distance between points. Otherwise, 0.