I became a dog owner in 2018 and one of the big constants in my life has become the need to walk Sparkle, my adorable spaniel and Labrador mix (aka @SparkleSprockerdor). I tend to walk Sparkle in a number of local parks, and walk between them through Victorian terraced streets built on a grid system. Whilst the grid system may inspire a future ‘Urban Maths’ article, today I am going to concentrate on the parks.
When in the park, I use an 8 m retractable lead to enable her to get lots of exercise at a speed greater than I am comfortable moving at. It occurred to me that the way she moves would create some interesting graphs, and be a great way to think about parametric equations.
The first equation I thought about was one where I walk in a straight line, and Sparkle approximately circles round me at a distance of 8 m. Let’s think about the maths of this.
Assume I walk at 1 m s and Sparkle runs at approximately 2 m s
, as convenient figures to illustrate the mathematics. Throughout this article, my position vector in metres can be written as
(1)
where is the time in seconds.
If Sparkle were just to run in a circle, starting at the point , her position would be:
(2)
where is chosen to define the speed.
As we are assuming a speed of 2 m s and noting that the circle above with radius 8 m has circumference
, then Sparkle will take
s to run around it. Thus, we require:
(3)
Hence, and the equation for Sparkle running in a circle becomes:
(4)
Using rules around addition of vectors, we can now create an approximate model for Sparkle circling me as I walk along the -axis at 1 m s
starting at the origin, assuming that Sparkle is constantly changing her velocity slightly to maintain the taut lead at 8 m:
(5)
which is illustrated in Figure 1.

The risk with this style of walking is that the lead wraps round the walker, thus creating a different graph. I leave that as an exercise for the enthusiastic reader!
The other way that Sparkle behaves when she is on the 8 m lead is to weave from left to right ahead of me. I imagine this is her gun dog breeding coming to the fore, as I think this would be how she would have been bred to flush game from woodland. Although Sparkle has never been trained, or used, for this purpose, it is interesting to see these characteristics emerge.
Thinking about how to model this, again I will take the stationary case first. Assume I stand at the origin. Sparkle starts at and then moves along an arc of radius 8 with the lead making a maximum angle of
(
radians) with the
-axis. Initially, Sparkle’s position could be described as:
(6)
as before, but this only works until the angle made is :
(7)
Hence, rather pleasingly, s.
Naturally one has to add in a element in the
component to incorporate my movement, and then add in some translation factors (fractional multiples of
) in the different sections.
In fact, for the period s to
s, this equation would hold whilst Sparkle is running in an anticlockwise direction:
(8)
For the period s to
s, she will be running clockwise and her position would be:
(9)
In fact, the full four vectors to describe her path as she weaves from side to side ahead of me, as I walk along the -axis at 1 m s
starting at the origin, assuming the lead is taut, are, for integer
, as follows.
For , where
mod
, then Sparkle’s movement is modelled by:
(10)
For , where
mod
, then Sparkle’s movement is modelled by:
(11)
For , where
mod
, then Sparkle’s movement is modelled by:
(12)
For , where
mod
, then Sparkle’s movement is modelled by:
(13)
These give the graph in Figure 2.

Reflecting on these curves, it occurred to me that a simpler model might be more realistic. Sparkle does not tend to be at the extreme end of the lead, so perhaps a different model is required.
For the second mathematical model, let Sparkle’s coordinate be driven by a sine curve, which would be:
(14)
where and
are chosen to make the speed and lead length ‘work’. Given her maximum distance from the
-axis should again be when the lead makes an angle of
radians with the
-axis, and the maximum lead length remains 8 m, the greatest distance from the
-axis will be
, so
m (
m). This will take Sparkle
s (
s) to run. This means
needs to be chosen such that
(15)
Thus,
(16)
Hence,
(17)
Thus, with the movement in the direction simply being at 1 m s
in time with me, the equation becomes:
(18)
which is shown in Figure 3.

This is (unsurprisingly) the simplest looking curve and I suspect closest to Sparkle’s actual path, as it allows her time to turn corners and the lead would not be permanently taut (which it is not when I walk her). It might be an interesting lesson to convert this into an equation. I leave that to the enthusiastic reader or dog lover!
Although in creating the three sets of parametric equations I have made some simplifying assumptions in respect of the real behaviour of a dog, I think the curves created, which have exploited parametric equations, trigonometry and modular arithmetic, are rather interesting examples of using real-world experiences to inspire mathematical thought.
Edward Rochead CMath CSci FIMA
Dstl
Acknowledgements
The graphs were created using www.desmos.com.
The author would like to thank Emma Bowley and Ronni Bowman for support in creating the graphs and animations and to Mike Lane and Linda Knutsen for reviewing the article.
‘Urban Maths’ cartoonist: Adrian Metcalfe
The views and opinions expressed herein are those of the author and do not necessarily reflect those of Dstl.
Reproduced from Mathematics Today, August 2020
Download the article, Urban Maths: Who Let the Dog Out? (pdf)




Hi Ed,
Great article to get the little grey cells working:) Thank you – to you & Sparkles for all your research:)
Funny – the graphs & different movement patterns immediately reminded me of people’s behaviour – especially when they have a task to do – or goal to achieve…
We know the direct route to get from where we are now – to where we want to be… yet often will expend energy left & right in varying forms – rather keeping focused… and so take longer as we do all that extra ‘millage’ in distractions, trivial tasks, procrastination etc:)))
Imagine, if as leaders, we could get ourselves, and our team… to progress directly from point a to b….. rather than exuding all that energy lost by being given the 8ft lead… 🙂
In the model of the dog running circles round you and you walking along the x axis the ground speed of the dog reaches 3m/s – when it is running along side you in the same direction. I hope your dog is strong enough to maintain this. Perhaps a more realistic model wrt the dog is to assume it runs at a constant speed relative to the ground and (maybe) at a tangent to the direction of the lead.
John, an interesting idea, if this thinking were taken further I suspect that approach would be worth exploring. Thank you.
Alice, a very interesting point, I look forward to discussing that at our next catch up.