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

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