My last post showed my, rather poor, attempt at solving this puzzle. Since the solution was posted online I thought I'd have a go at using my Excel skills to plot the path of the dog and the duck. And the aim was to use no VBA.
My spreadsheet shows plots the paths of the dog and the duck and lets the user change the radius of the pool, the dog speed multiplier and the time. The same assumptions are made in this spreadsheet as in my previous post.
The path of the dog is pretty boring, 1 direction around the pool until it reaches the point where the duck meets the edge.
The ducks path varies depending on the dogs speed
- Dog speed multiplier less than pi the duck goes straight to the edge on a radial path
- Dog multiplier between pi and pi+1, duck remains opposite the dog until the edge of optimal circle then takes a radial path
- Dog speed over pi+1, duck remains opposite the dog until the edge of the optimal circle and then takes a straight path to the edge of the pool tangentially to the optimal circle.
The user can edit the time and toggle the display of the optimal circle using form controls.
Once the time is reached where either the duck escapes or the do catches the duck then the winning time is displayed rounded to the nearest second.
My spreadsheet is here Dog and duck
Edit 1 (I'm hoping for at least 1 more)
With a slight modification I have removed the need for option 1 since it is just a special case of option 2. The aim is now to combine options 2 and 3, or at least make the transition between the two smoother.
New features in Dog and duck v2
Scroll bar to move smoothly between different dog speed multipliers. This actually makes a number 100 times the multiplier we want so a calculation cell is needed to divide by 100.
When the dogs multiplier is less than pi+1 the duck always travels the shortest distance it can and still escape
- Multiplier < pi, the duck takes a radial path
- Multiplier between pi and pi+1 the duck takes a curved path staying opposite the dog until it can take a radial path.
- Multiplier > pi+1 then the path jumps to the worst case scenario for the duck where it either escapes or it doesn't.