Package org.djutils.draw.curve
Class Flattener2d.MaxDeviationAndAngle
java.lang.Object
org.djutils.draw.curve.Flattener2d.MaxDeviationAndAngle
- All Implemented Interfaces:
Flattener<Flattener2d,,Curve2d, PolyLine2d, Point2d, Double> Flattener2d
- Enclosing interface:
- Flattener2d
Flattener that limits the distance and angle difference between the
Curve2d and the
PolyLine2d.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.djutils.draw.curve.Flattener
Flattener.FlattableCurve<P,DIR> Nested classes/interfaces inherited from interface org.djutils.draw.curve.Flattener2d
Flattener2d.MaxAngle, Flattener2d.MaxDeviation, Flattener2d.MaxDeviationAndAngle, Flattener2d.NumSegments -
Constructor Summary
ConstructorsConstructorDescriptionMaxDeviationAndAngle(double maxDeviation, double maxAngle) Construct a flattener that limits the distance and angle difference between thecurve2dand thePolyLine2d. -
Method Summary
Modifier and TypeMethodDescriptionFlatten a Curve2d into a PolyLine2d.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.djutils.draw.curve.Flattener
checkInflectionPoint, checkPositionError, loadKnot, loadKnotsMethods inherited from interface org.djutils.draw.curve.Flattener2d
checkDirectionError, checkLoopBack
-
Constructor Details
-
MaxDeviationAndAngle
public MaxDeviationAndAngle(double maxDeviation, double maxAngle) Construct a flattener that limits the distance and angle difference between thecurve2dand thePolyLine2d.- Parameters:
maxDeviation- maximum deviation, must be above 0.0maxAngle- maximum angle, must be above 0.0- Throws:
ArithmeticException- whenmaxDeviation, ormaxAngleisNaNIllegalArgumentException- whenmaxDeviation ≤ 0.0, ormaxAngle ≤ 0.0
-
-
Method Details
-
flatten
Description copied from interface:Flattener2dFlatten a Curve2d into a PolyLine2d.- Specified by:
flattenin interfaceFlattener2d- Parameters:
curve- the curve- Returns:
- flattened line
- Throws:
NullPointerException- whencurveisnull
-