describe math behind velocity function