Parametric equations for hypocycloid and epicycloid Suppose that the small circle rolls inside the larger circle and that the point $P$ we follow lies on the circumference of the small circle. If the initial configuration is such that $P$ is at $(a,0)$, find parametric equations for the curve traced by $P$, using angle $t$ from the positive $x$-axis to the center $B$ of the moving circle. The resulting curve is called a hypocycloid.
The following is the solution from  the text.
The center of the moving circle is at $(a-b)$$(\cos(t),\sin(t))$. Notice that as the moving circle rolls so that its center moves counterclockwise it is turning clockwise relative to its center. When the small circle has traveled completely around the large circle it has rolled over a length of $2\pi(a)$. Its circumference is $2\pi b$ so if it were rolling along a straight line it would have revolved $a/b$ times. 
So far I understand the story. However,
The problem is that it is rolling around in a circle and so it has lost a rotation each time the center has traveled completely around. In other words the smaller wheel is turning at a rate of $((a/b)-1)t$$=$$(a-b)t/b$.
I don't understand the preceding sentences. Why does it mean that it loses a rotation each time the center has traveled completely around and why is that so? Also, I don't see how this brings the final equation. Moreover, how is the rate of the smaller wheel turning translated as the angle of $P$?
The position of $P$ relative to the center of the moving circle is 
$$b(\cos(-\frac{(a-b)t}{b}),\sin(-\frac{(a-b)t}{b}))=b(\cos(\frac{(a-b)t}{b}),-\sin(\frac{(a-b)t}{b}))$$.
Also, why is the rate multiplied my $-$, the negative sign, in this equation?
On the other hand, now suppose that the small circle rolls on the outside of the larger circle. Derive a set of parametric equations for the resulting curve in this case. Such a curve is called an epicycloid.
In this case, the moving circle now gains one revolution each time around the fixed circle and so turns at a rate of $((a/b)+1)t=(a+b)t/b$. I think this is pretty much the same story, however, likewise, I don't understand the part where it gains a revolution, and how that rate of turning represents the angle.
Would anyone carefully explain the questions to me? I'm really confused and I'd appreciate some help.
 A: Assuming that tha motion starts in the fixed point A(a,0), we can write the coordinate of the center B of the moving circle  as
\begin{equation}
((a-b) \cos(t), (a-b) \sin(t))
\end{equation}
The coordinate of the moving point P relative to B are:
\begin{equation}
(b \cos(\phi), -b \sin(\phi))
\end{equation}
where the minus sign is due to the fact that $\phi$ is measured clockwise. Thus the coordinate of P relative to O are:
\begin{equation}
((a-b) \cos(t)+b \cos(\phi), (a-b) \sin(t)-b \sin(\phi))
\end{equation}
In order to avoid misunderstanding I added a picture.

The key point is that the angle $t$ and $\phi$ are related to each other. As a matter of fact, the arcs of the fixed and moving circles that came in contact (arcs AA' and A'P) must be of equal length. The arc length is
\begin{equation}
AA'= a t
\end{equation}
while 
\begin{equation}
A'P= b(t+\phi)
\end{equation}
We can then conclude that 
\begin{equation}
\phi=(\frac{a}{b}-1)t
\end{equation}
The coordinates of the point P respect to the origin O are:
\begin{equation}
x=(a-b) \cos(t)+b \cos((\frac{a}{b}-1)t)
\end{equation}
\begin{equation}
y=(a-b) \sin(t)-b \sin((\frac{a}{b}-1)t)
\end{equation}
Note that if the rolling circle move at constant angular velocity, t will be proportional to the elapsed time. For the case of an epicycloid you can derive the equation in a similar way. You should get something like:
\begin{equation}
x=(a+b) \cos(t)-b \cos((\frac{a}{b}+1)t)
\end{equation}
\begin{equation}
y=(a+b) \sin(t)-b \sin((\frac{a}{b}+1)t)
\end{equation}
the minus sign in the second term of the equation of the x coordinate is due to the fact that the rotation of the rolling circle and the motion of its center are in the same direction. 
The relationship between the angle $t$ and $\phi$ can be written as 
\begin{equation}
\phi=(\frac{2 \pi a}{2 \pi b}-1)t
\end{equation}
Than the ratio $a/b$ tell us how many times the circumference of the stationary circle exceed that of the rolling one. For sake of simplicity we call this ratio $n$. The stationary circle has a radius $a= n b$. When $t$ ranges from 0 to $2 \pi$ the angle $\phi$ ranges from 0 to $2 \pi(n-1)$, i.e. $n-1$ times less and not $n$ times less. In this sense the smaller circle has lost a rotation.   
A: Consider two spur gears, output wheel of radius n times smaller than the center wheel making external contact during rotation. Imagine a link/crank  L connecting the center of two gears.
When L is fixed, outer gear rotates faster n times.
Now make L free and arrest the first wheel.Suddenly the speed increase falls to only (n-1) times compensating for inner wheel rotation. The relative angle or speed is unaffected.
For external contact output wheel angle/speed increases (n+1) times. 
