src/main/java/org/a05annex/util/geo2d/KochanekBartelsSpline.java
@NotNull
    public ControlPoint addControlPoint(double fieldX, double fieldY, double fieldHeading, double time) {
        // make the time valid
        if (null == m_last) {
            time = 0.0;
        } else if (time <= m_last.m_time) {
            time = m_last.m_time + 1.0;
        }

        // add the point to the end of the curve
        ControlPoint newControlPoint = new ControlPoint(time);
        if (null == m_first) {
            m_first = newControlPoint;
        }
        if (null != m_last) {
            m_last.m_next = newControlPoint;
            newControlPoint.m_last = m_last;
        }
        m_last = newControlPoint;
        newControlPoint.setFieldLocation(fieldX, fieldY);
        newControlPoint.setFieldHeading(fieldHeading);
        return newControlPoint;
    }
/**
     * Add a control point to the end of the path, which will extend that path to that new control point.
     *
     * @param fieldX       The X field position for the added control point.
     * @param fieldY       The field Y position for the added control point.
     * @param fieldHeading The heading for the added control point.
     * @param time         The time the added control point should be reached. This should be greater than the time
     *                     of the last control point, and will be set to time of the last control point + 1.0 if
     *                     not. If this is the first control point of the path the time will be set to 0.0.
     * @return Returns the added control point.
     */
Add a control point to the end of the path, which will extend that path to that new control point.
@param fieldX       The X field position for the added control point.
@param fieldY       The field Y position for the added control point.
@param fieldHeading The heading for the added control point.
@param time         The time the added control point should be reached. This should be greater than the time
of the last control point, and will be set to time of the last control point + 1.0 if
not. If this is the first control point of the path the time will be set to 0.0.
@return Returns the added control point.
Add a control point to the end of the path which will extend that path to that new control point . @param fieldX The X field position for the added control point . @param fieldY The field Y position for the added control point . @param fieldHeading The heading for the added control point . @param time The time the added control point should be reached . This should be greater than the time of the last control point and will be set to time of the last control point + 1 . 0 if not . If this is the first control point of the path the time will be set to 0 . 0 . @return Returns the added control point .
@NotNull
    public ControlPoint addControlPoint(double fieldX, double fieldY, double fieldHeading, double time) {
        if (null == m_last) {
            time = 0.0;
        } else if (time <= m_last.m_time) {
            time = m_last.m_time + 1.0;
        }
        ControlPoint newControlPoint = new ControlPoint(time);
        if (null == m_first) {
            m_first = newControlPoint;
        }
        if (null != m_last) {
            m_last.m_next = newControlPoint;
            newControlPoint.m_last = m_last;
        }
        m_last = newControlPoint;
        newControlPoint.setFieldLocation(fieldX, fieldY);
        newControlPoint.setFieldHeading(fieldHeading);
        return newControlPoint;
    }
@ NotNull public ControlPoint addControlPoint ( double fieldX , double fieldY , double fieldHeading , double time ) { if ( null == m_last ) { time = 0.0 ; } else if ( time <= m_last . m_time ) { time = m_last . m_time + 1.0 ; } ControlPoint newControlPoint = new ControlPoint ( time ) ; if ( null == m_first ) { m_first = newControlPoint ; } if ( null != m_last ) { m_last . m_next = newControlPoint ; newControlPoint . m_last = m_last ; } m_last = newControlPoint ; newControlPoint . setFieldLocation ( fieldX , fieldY ) ; newControlPoint . setFieldHeading ( fieldHeading ) ; return newControlPoint ; }
Add a control point to the end of the path, which will extend that path to that new control point.
Add a control point to the end of the path which will extend that path to that new control point .
// make the time valid // add the point to the end of the curve