src/test/java/org/a05annex/util/geo2d/TestSpline.java
@Test
    @DisplayName("Verify different segment times")
    void testSet3_verifyDifferentSegmentTimes() {
        m_adjustTimeTest.setSpeedMultiplier(1.0);
        assertEquals(1.0, m_adjustTimeTest.getSpeedMultiplier());
        KochanekBartelsSpline.PathFollower follower = m_adjustTimeTest.getPathFollower();
        double time = 0.0;
        KochanekBartelsSpline.PathPoint pathPt;
        while (null != (pathPt = follower.getPointAt(time))) {
            assertEquals(time, pathPt.time, 0.00001);
            assertEquals(REF_SPEED, pathPt.speedStrafe, 0.00001);
            time += 0.1;
        }

        m_adjustTimeTestPoints.get(2).setTime(2.5, false);
        m_adjustTimeTestPoints.get(2).setFieldLocation(2.5 * REF_SPEED, 0.0);
        follower = m_adjustTimeTest.getPathFollower();
        time = 0.0;
        while (null != (pathPt = follower.getPointAt(time))) {
            assertEquals(time, pathPt.time, 0.00001);
            assertEquals(REF_SPEED, pathPt.speedStrafe, 0.00001);
            time += 0.1;
        }

        m_adjustTimeTestPoints.get(1).setTime(1.5, false);
        m_adjustTimeTestPoints.get(1).setFieldLocation(1.5 * REF_SPEED, 0.0);
        follower = m_adjustTimeTest.getPathFollower();
        time = 0.0;
        while (null != (pathPt = follower.getPointAt(time))) {
            assertEquals(time, pathPt.time, 0.00001);
            assertEquals(REF_SPEED, pathPt.speedStrafe, 0.00001);
            time += 0.1;
        }
    }
/**
     * This is a test that moves control points in time along a linear path with a constant speed to assure the
     * path remains constant regardless of where in time the points are positioned.
     */
This is a test that moves control points in time along a linear path with a constant speed to assure the
path remains constant regardless of where in time the points are positioned.
This is a test that moves control points in time along a linear path with a constant speed to assure the path remains constant regardless of where in time the points are positioned .
@Test
    @DisplayName("Verify different segment times")
    void testSet3_verifyDifferentSegmentTimes() {
        m_adjustTimeTest.setSpeedMultiplier(1.0);
        assertEquals(1.0, m_adjustTimeTest.getSpeedMultiplier());
        KochanekBartelsSpline.PathFollower follower = m_adjustTimeTest.getPathFollower();
        double time = 0.0;
        KochanekBartelsSpline.PathPoint pathPt;
        while (null != (pathPt = follower.getPointAt(time))) {
            assertEquals(time, pathPt.time, 0.00001);
            assertEquals(REF_SPEED, pathPt.speedStrafe, 0.00001);
            time += 0.1;
        }
        m_adjustTimeTestPoints.get(2).setTime(2.5, false);
        m_adjustTimeTestPoints.get(2).setFieldLocation(2.5 * REF_SPEED, 0.0);
        follower = m_adjustTimeTest.getPathFollower();
        time = 0.0;
        while (null != (pathPt = follower.getPointAt(time))) {
            assertEquals(time, pathPt.time, 0.00001);
            assertEquals(REF_SPEED, pathPt.speedStrafe, 0.00001);
            time += 0.1;
        }
        m_adjustTimeTestPoints.get(1).setTime(1.5, false);
        m_adjustTimeTestPoints.get(1).setFieldLocation(1.5 * REF_SPEED, 0.0);
        follower = m_adjustTimeTest.getPathFollower();
        time = 0.0;
        while (null != (pathPt = follower.getPointAt(time))) {
            assertEquals(time, pathPt.time, 0.00001);
            assertEquals(REF_SPEED, pathPt.speedStrafe, 0.00001);
            time += 0.1;
        }
    }
@ Test @ DisplayName ( "Verify different segment times" ) void testSet3_verifyDifferentSegmentTimes ( ) { m_adjustTimeTest . setSpeedMultiplier ( 1.0 ) ; assertEquals ( 1.0 , m_adjustTimeTest . getSpeedMultiplier ( ) ) ; KochanekBartelsSpline . PathFollower follower = m_adjustTimeTest . getPathFollower ( ) ; double time = 0.0 ; KochanekBartelsSpline . PathPoint pathPt ; while ( null != ( pathPt = follower . getPointAt ( time ) ) ) { assertEquals ( time , pathPt . time , 0.00001 ) ; assertEquals ( REF_SPEED , pathPt . speedStrafe , 0.00001 ) ; time += 0.1 ; } m_adjustTimeTestPoints . get ( 2 ) . setTime ( 2.5 , false ) ; m_adjustTimeTestPoints . get ( 2 ) . setFieldLocation ( 2.5 * REF_SPEED , 0.0 ) ; follower = m_adjustTimeTest . getPathFollower ( ) ; time = 0.0 ; while ( null != ( pathPt = follower . getPointAt ( time ) ) ) { assertEquals ( time , pathPt . time , 0.00001 ) ; assertEquals ( REF_SPEED , pathPt . speedStrafe , 0.00001 ) ; time += 0.1 ; } m_adjustTimeTestPoints . get ( 1 ) . setTime ( 1.5 , false ) ; m_adjustTimeTestPoints . get ( 1 ) . setFieldLocation ( 1.5 * REF_SPEED , 0.0 ) ; follower = m_adjustTimeTest . getPathFollower ( ) ; time = 0.0 ; while ( null != ( pathPt = follower . getPointAt ( time ) ) ) { assertEquals ( time , pathPt . time , 0.00001 ) ; assertEquals ( REF_SPEED , pathPt . speedStrafe , 0.00001 ) ; time += 0.1 ; } }
This is a test that moves control points in time along a linear path with a constant speed to assure the
 path remains constant regardless of where in time the points are positioned.
This is a test that moves control points in time along a linear path with a constant speed to assure the path remains constant regardless of where in time the points are positioned .