public class ConvexHullFlatnessAlgo extends Object implements QuadFlatnessAlgorithm, CubicFlatnessAlgorithm
| Constructor and Description |
|---|
ConvexHullFlatnessAlgo() |
| Modifier and Type | Method and Description |
|---|---|
double |
getFlatness(CubicCurve2D curve)
Returns the square root of the
getSquaredFlatness(CubicCurve2D)
(so use getSquaredFlatness(CubicCurve2D) if possible instead
of this one, it will be less computational intensive). |
double |
getFlatness(QuadCurve2D curve)
Returns the square root of the
getSquaredFlatness(QuadCurve2D)
(so use getSquaredFlatness(QuadCurve2D) if possible instead
of this one, it will be less computational intensive). |
double |
getSquaredFlatness(CubicCurve2D curve)
Returns the maximum
squared distance between the two control points and the
segment defined by the curve's anchor points. |
double |
getSquaredFlatness(QuadCurve2D curve)
Returns the
square distance between the control point of the curve and
the segment defined by its anchor points. |
boolean |
isDegenerationRobust()
Always return
true., and that's because the
DistUtils.pointToSegSqEucDist(double, double, double, double, double, double)
method is used, so if any of the anchor points is on the line defined by the
anchor points but falls outside the segment, then the method will return a
non-zero distance for it. |
boolean |
isSquaredFlatenessPreferred()
Always return
true. |
public final boolean isDegenerationRobust()
true., and that's because the
DistUtils.pointToSegSqEucDist(double, double, double, double, double, double)
method is used, so if any of the anchor points is on the line defined by the
anchor points but falls outside the segment, then the method will return a
non-zero distance for it.isDegenerationRobust in interface CubicFlatnessAlgorithmisDegenerationRobust in interface QuadFlatnessAlgorithmpublic final boolean isSquaredFlatenessPreferred()
true.isSquaredFlatenessPreferred in interface CubicFlatnessAlgorithmisSquaredFlatenessPreferred in interface QuadFlatnessAlgorithmpublic final double getFlatness(QuadCurve2D curve)
getSquaredFlatness(QuadCurve2D)
(so use getSquaredFlatness(QuadCurve2D) if possible instead
of this one, it will be less computational intensive).getFlatness in interface QuadFlatnessAlgorithmpublic final double getSquaredFlatness(QuadCurve2D curve)
square distance between the control point of the curve and
the segment defined by its anchor points.getSquaredFlatness in interface QuadFlatnessAlgorithmpublic final double getFlatness(CubicCurve2D curve)
getSquaredFlatness(CubicCurve2D)
(so use getSquaredFlatness(CubicCurve2D) if possible instead
of this one, it will be less computational intensive).getFlatness in interface CubicFlatnessAlgorithmpublic final double getSquaredFlatness(CubicCurve2D curve)
squared distance between the two control points and the
segment defined by the curve's anchor points.getSquaredFlatness in interface CubicFlatnessAlgorithmCopyright © 2016. All rights reserved.