FtcXtensible/src/main/java/org/ftccommunity/i2clibrary/navigation/NavUtil.java
public static Position meanIntegrate(Velocity cur, Velocity prev) {
        double duration = (cur.nanoTime - prev.nanoTime) * 1e-9;
        Velocity meanVelocity = scale(plus(cur, prev), 0.5);
        return integrate(meanVelocity, duration);
    }
/**
     * Integrate between two velocities to determine a change in position using an assumption that
     * the mean of the velocities has been acting the entire interval.
     *
     * @param cur  the current velocity
     * @param prev the previous velocity
     * @return an approximation to the change in position over the interval
     * @see <a href="https://en.wikipedia.org/wiki/Simpson%27s_rule">Simpson's Rule</a>
     */
Integrate between two velocities to determine a change in position using an assumption that
the mean of the velocities has been acting the entire interval.

@param cur  the current velocity
@param prev the previous velocity
@return an approximation to the change in position over the interval
@see Simpson's Rule
Integrate between two velocities to determine a change in position using an assumption that the mean of the velocities has been acting the entire interval . @param cur the current velocity @param prev the previous velocity @return an approximation to the change in position over the interval @see Simpson ' s Rule
public static Position meanIntegrate(Velocity cur, Velocity prev) {
        double duration = (cur.nanoTime - prev.nanoTime) * 1e-9;
        Velocity meanVelocity = scale(plus(cur, prev), 0.5);
        return integrate(meanVelocity, duration);
    }
public static Position meanIntegrate ( Velocity cur , Velocity prev ) { double duration = ( cur . nanoTime - prev . nanoTime ) * 1e-9 ; Velocity meanVelocity = scale ( plus ( cur , prev ) , 0.5 ) ; return integrate ( meanVelocity , duration ) ; }
Integrate between two velocities to determine a change in position using an assumption that
 the mean of the velocities has been acting the entire interval.
Integrate between two velocities to determine a change in position using an assumption that the mean of the velocities has been acting the entire interval .