FitCircle2D
jhpro.fit

## Class FitCircle2D

• `public class FitCircle2Dextends Object`
Class `Circle` handles a circle (or a portion of circle) which approximates a collection of data points. Besides usual characteristics of a circle (center, radius), and of a circle arc (start and stop angles) it also defines the approximating bezier curve.
• ### Constructor Summary

Constructors
Constructor and Description
`FitCircle2D(double[] x, double[] y)`
Creates a new instance of Circle, defined by a set of points.
`FitCircle2D(P1D p)`
Creates a new instance of Ellipse, defined by P1D
`FitCircle2D(Point2D left, Point2D middle, Point2D right, double[] x, double[] y)`
Creates a new instance of Circle, fitted to 3 defining points.
• ### Method Summary

Methods
Modifier and TypeMethod and Description
`void``doc()`
Show online documentation.
`Point2D.Double``getCenter()`
Report the circle center.
`Circle``getCircle()`
Return fitted circle.
`CubicCurve2D.Double``getCurve()`
Report the Bezier curve which best approximates the circle arc.
`double``getDistance()`
Report the mean distance between the data points and the circle.
`Double``getRadius()`
`Double``getStartAngle()`
Report the angle at start of the circle arc.
`Double``getStopAngle()`
Report the angle at stop of the circle arc.
`String``toString()`
• ### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`
• ### Constructor Detail

• #### FitCircle2D

`public FitCircle2D(double[] x,           double[] y)`
Creates a new instance of Circle, defined by a set of points.
Parameters:
`x` - array of abscissae
`y` - array of ordinates
• #### FitCircle2D

`public FitCircle2D(P1D p)`
Creates a new instance of Ellipse, defined by P1D
Parameters:
`P1D` - input
• #### FitCircle2D

`public FitCircle2D(Point2D left,           Point2D middle,           Point2D right,           double[] x,           double[] y)`
Creates a new instance of Circle, fitted to 3 defining points. The provided collection of coordinates is used only to compute the resulting distance.
Parameters:
`left` - left defining point
`middle` - middle defining point
`right` - right defining point
`x` - array of abscissae (including the defining points)
`y` - array of ordinates (including the defining points)
• ### Method Detail

• #### getCenter

`public Point2D.Double getCenter()`
Report the circle center.
Returns:
the center of the circle
• #### getCurve

`public CubicCurve2D.Double getCurve()`
Report the Bezier curve which best approximates the circle arc.
Returns:
the Bezier curve
• #### getDistance

`public double getDistance()`
Report the mean distance between the data points and the circle.
Returns:
the mean distance

`public Double getRadius()`
Returns:
• #### getStartAngle

`public Double getStartAngle()`
Report the angle at start of the circle arc.
Returns:
• #### getStopAngle

`public Double getStopAngle()`
Report the angle at stop of the circle arc.
Returns:
• #### toString

`public String toString()`
Overrides:
`toString` in class `Object`
• #### getCircle

`public Circle getCircle()`
Return fitted circle.
Returns:
fitted circle.
• #### doc

`public void doc()`
Show online documentation.