calculate stride