spring = function spring(update) {
    var stiffness = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.5;
    var damping = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.75;
    var mass = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 10;

    return function (cb) {
        var from = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
        var to = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

        update(cb, from, to, function (state, cancel) {
            // calculate spring force
            var f = -(state.position - state.destination) * stiffness;

            // update velocity by adding force based on mass
            state.velocity += f / mass;

            // update position by adding velocity
            state.position += state.velocity;

            // slow down based on amount of damping
            state.velocity *= damping;

            // we've arrived if we're near target and our velocity is near zero
            if (thereYet(state.position, state.destination, state.velocity)) {
                cancel();
                state.position = state.destination;
                state.velocity = 0;
            }
        });
    };
}
Animate movement based no spring physics
@param update
@param stiffness - the higher the more intense the vibration
@param damping - a factor that slows down the calculated velocity by a percentage, needs to be less than 1
@param mass - the higher the slower the spring springs in action
@returns {function(*=, *=)}