Theoretical path following code