public Vector3f mean(Vector3f storeResult) {
        int numVectors = numVectors();
        assert numVectors > 0 : numVectors;
        Vector3f result = (storeResult == null) ? new Vector3f() : storeResult;

        result.zero();
        for (Vector3f tempVector : set) {
            result.addLocal(tempVector);
        }
        result.divideLocal(numVectors);

        return result;
    }
Calculate the sample mean for each axis over the Vector3f values in this
set.

@param storeResult (modified if not null)
@return the sample mean for each axis (either storeResult or a new
Vector3f)
jme3-jbullet/src/main/java/com/jme3/bullet/animation/VectorSet.java