move some MovingAtConstantSpeed function implement codes into .cpp instead of .h