Add option to calculate either x or y speed.