Package org.djutils.draw.curve
Class BezierTest
java.lang.Object
org.djutils.draw.curve.BezierTest
Test the Bézier class.
 
 Copyright (c) 2013-2025 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. 
 BSD-style license. See OpenTrafficSim License.
 
- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version Jan 2, 2017 
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionfinal voidTest the various 2d methods in the Bezier class.final voidTest the various 3d methods in the Bezier class.voidcompareBeziers(String description, PolyLine2d reference, PolyLine2d candidate, int numberOfPoints, double epsilon) Compare Bézier curve approximations.voidcompareBeziersDeviation(String description, PolyLine3d reference, PolyLine3d candidate, int numberOfPoints, double epsilon) Compare Bézier curve approximations.voidTest the length of a BezierCubic3d.voidTest the various exceptions of the 2d methods in the Bezier class.voidTest the various exceptions of the 3d methods in the Bezier class.voidTest the factorial method.
- 
Constructor Details- 
BezierTestpublic BezierTest()
 
- 
- 
Method Details- 
bezierTest2dTest the various 2d methods in the Bezier class.
- 
compareBezierspublic void compareBeziers(String description, PolyLine2d reference, PolyLine2d candidate, int numberOfPoints, double epsilon) Compare Bézier curve approximations.- Parameters:
- description- description of the test
- reference- reference Bézier curve approximation
- candidate- candidate Bézier curve approximation
- numberOfPoints- number of point to compare the curves at, minus one; this method checks at 0% and at 100%
- epsilon- upper limit of the distance between the two curves
 
- 
compareBeziersDeviationpublic void compareBeziersDeviation(String description, PolyLine3d reference, PolyLine3d candidate, int numberOfPoints, double epsilon) Compare Bézier curve approximations.- Parameters:
- description- description of the test
- reference- reference Bézier curve approximation
- candidate- candidate Bézier curve approximation
- numberOfPoints- number of point to compare the curves at, minus one; this method checks at 0% and at 100%
- epsilon- upper limit of the distance between the two curves
 
- 
bezierTest3dTest the various 3d methods in the Bezier class.
- 
testBezierLengthTest the length of a BezierCubic3d.
- 
testExceptions2dTest the various exceptions of the 2d methods in the Bezier class.
- 
testExceptions3dTest the various exceptions of the 3d methods in the Bezier class.
- 
testFactorial@Test public void testFactorial() throws NoSuchMethodException, SecurityException, IllegalAccessException, IllegalArgumentException, InvocationTargetExceptionTest the factorial method.- Throws:
- SecurityException- if that happens, this test has failed
- NoSuchMethodException- if that happens, this test has failed
- InvocationTargetException- if that happens, this test has failed
- IllegalArgumentException- if that happens, this test has failed
- IllegalAccessException- if that happens, this test has failed
 
 
-