Please note that you have the freedom to choose the origin (and direction) of the parametrization. In the photo below, I worked out the problem with two alternative choices. In red ink, I set s=0 at (x0, y0) and called s* the value where we are on the initial segment In blue ink, I did the opposite. Both work, and give the same final answer.