It seems you have to find minimum distance to the point which is x minimux x points away from the next point in the route.
I would suggesting finding the shortest distance between the starting point and all the circles cirumfrence , then choosing the shortest value and again repeating the same step.
So it will be like .
you have 4 points and you start at point 1(starting point which is at the cicumfrence of the circle 1),
calculate the shortest distance using shortest distance formula from cirumfrence
for the rest of the 3 circles (The distance will be calculated from point 1 to the circumfrence of all 3 circles ) and after that select the minimum distance from three.
Now move to point two (the one has the shortest distance) and repeat same for other two points left.
circle1(x0,y0)
circle2(xx0,yy0)
circle3(xxx0,yyy0)
circle4(xxxx0,yyyy0)
cirle 1 (x0,y0) is the center and you have **p1** on circumfrence p1(x1,y1)
from p1 calculate the shortest distance to all three circles like
distance from p1 to circle2
Distp1Toc2= sqrt(square(x1-xx0) + square(y1-yy0) -r) // this will give you shortest distance from point 1 to a point on circle2 cirumfrence
repeat this for circle3 and cirlce4 to calculate **Dist_p1_To_c3** and **Dist_p1_To_c4** then select the minimum distance
lets consider **Dist_p1_To_c2** is minimum and now from the point Dist_p1_To_c2 again calculate the distance to circle 3 and circle4 to find minimum distance.