Class BezierTest

java.lang.Object
org.djutils.draw.line.BezierTest

public class BezierTest extends Object
Test the Bézier class.

Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
  • Constructor Details

    • BezierTest

      public BezierTest()
  • Method Details

    • bezierTest2d

      @Test public final void bezierTest2d() throws DrawRuntimeException, DrawRuntimeException
      Test the various 2d methods in the Bezier class.
      Throws:
      DrawRuntimeException - when this happens uncaught this test has failed
      DrawRuntimeException - when this happens uncaught; this test has failed
    • compareBeziers

      public void compareBeziers(String description, PolyLine2d reference, PolyLine2d candidate, int numberOfPoints, double epsilon) throws DrawRuntimeException
      Compare Bézier curve approximations.
      Parameters:
      description - String; description of the test
      reference - PolyLine2d; reference Bézier curve approximation
      candidate - PolyLine2d; candidate Bézier curve approximation
      numberOfPoints - int; number of point to compare the curves at, minus one; this method checks at 0% and at 100%
      epsilon - double; upper limit of the distance between the two curves
      Throws:
      DrawRuntimeException - if that happens uncaught; a test has failed
    • compareBeziers

      public void compareBeziers(String description, PolyLine3d reference, PolyLine3d candidate, int numberOfPoints, double epsilon) throws DrawRuntimeException
      Compare Bézier curve approximations.
      Parameters:
      description - String; description of the test
      reference - PolyLine3d; reference Bézier curve approximation
      candidate - PolyLine3d; candidate Bézier curve approximation
      numberOfPoints - int; number of point to compare the curves at, minus one; this method checks at 0% and at 100%
      epsilon - double; upper limit of the distance between the two curves
      Throws:
      DrawRuntimeException - if that happens uncaught; a test has failed
    • bezierTest3d

      @Test public final void bezierTest3d() throws DrawRuntimeException
      Test the various 3d methods in the Bezier class.
      Throws:
      DrawRuntimeException - when this happens uncaught this test has failed
    • testExceptions2d

      @Test public void testExceptions2d()
      Test the various exceptions of the 2d methods in the Bezier class.
    • testExceptions3d

      @Test public void testExceptions3d()
      Test the various exceptions of the 3d methods in the Bezier class.
    • testFactorial

      Test 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