The period of $\cos t$ and $\sin t$ is $2\pi$.
For any positive constant $k$, the period of $\cos kt$ and $\sin kt$ is $2\pi/k$.
(Because $\cos (k(t+p)) = \cos (kt +kp)$ so $kp$ has to be the period $2\pi$ of $\cos t$.)
So, now each of the two coordinates is a sum of a function with period $2\pi$ and a function with period $2\pi k = 2\pi \frac nd$ if we set $\frac{a-b}{b}=\frac dn$ as your book does (unless $h=0$ or $a=b$ and the function is actually simpler).
If the two function do not have the same period (i.e. $d\
ot=n$) we now have to find the first time when both periods have been completed an integral number of times, so we need simultaneously a multiple of $2\pi$ and a multiple of $2\pi\frac nd$.
But this happens first at $2\pi n$.