jhpro.fit
Class FitCircle2D
- java.lang.Object
-
- jhpro.fit.FitCircle2D
-
public class FitCircle2D extends java.lang.ObjectClassCirclehandles 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 P1DFitCircle2D(java.awt.geom.Point2D left, java.awt.geom.Point2D middle, java.awt.geom.Point2D right, double[] x, double[] y)Creates a new instance of Circle, fitted to 3 defining points.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddoc()Show online documentation.java.awt.geom.Point2D.DoublegetCenter()Report the circle center.CirclegetCircle()Return fitted circle.java.awt.geom.CubicCurve2D.DoublegetCurve()Report the Bezier curve which best approximates the circle arc.doublegetDistance()Report the mean distance between the data points and the circle.java.lang.DoublegetRadius()Report the circle radius.java.lang.DoublegetStartAngle()Report the angle at start of the circle arc.java.lang.DoublegetStopAngle()Report the angle at stop of the circle arc.java.lang.StringtoString()
-
-
-
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 abscissaey- array of ordinates
-
FitCircle2D
public FitCircle2D(P1D p)
Creates a new instance of Ellipse, defined by P1D- Parameters:
P1D- input
-
FitCircle2D
public FitCircle2D(java.awt.geom.Point2D left, java.awt.geom.Point2D middle, java.awt.geom.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 pointmiddle- middle defining pointright- right defining pointx- array of abscissae (including the defining points)y- array of ordinates (including the defining points)
-
-
Method Detail
-
getCenter
public java.awt.geom.Point2D.Double getCenter()
Report the circle center.- Returns:
- the center of the circle
-
getCurve
public java.awt.geom.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
-
getRadius
public java.lang.Double getRadius()
Report the circle radius.- Returns:
- the circle radius
-
getStartAngle
public java.lang.Double getStartAngle()
Report the angle at start of the circle arc.- Returns:
- the starting angle, in radians
-
getStopAngle
public java.lang.Double getStopAngle()
Report the angle at stop of the circle arc.- Returns:
- the stopping angle, in radians
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getCircle
public Circle getCircle()
Return fitted circle.- Returns:
- fitted circle.
-
doc
public void doc()
Show online documentation.
-
-
DMelt 3.0 © DataMelt by jWork.ORG