converts 'speed' and 'direction' into expression functions