Just for fun, here is a variation of C. E.'s animation, which demonstrates that an epicycloid can be constructed as an envelope of the diameter of a rolling circle:
With[{n = 3, r = 1, m = 31},
Animate[ParametricPlot[ReIm[(n + 1) r E^(I t) - r E^(I (n + 1) t)],
{t, 0, 2 Denominator[n] π}, Axes -> None,
Epilog -> {Circle[ReIm[(n + 2) r E^(I u)], 2 r],
{Red, Line[{ReIm[(n + 2) r E^(I u) -
2 r E^(I (1 + n/2) u)],
ReIm[(n + 2) r E^(I u) +
2 r E^(I (1 + n/2) u)]}]}},
Frame -> True, PlotRange -> (n + 4) r,
PlotStyle -> Red, Prolog -> {Blue, Circle[{0, 0}, n r]}],
{u, 0, 2 Denominator[n] π, (2 Denominator[n] π)/(m - 1)}]]

(Note the use of the complex form of the epicycloid.)
A slight modification of the code given above can be done to produce the multiple exposure version:

If one just wants to see the lines enveloping the epicycloid, the code is much simpler:
With[{n = 3, r = 1, m = 101},
Graphics[{Opacity[1/5],
Table[InfiniteLine[{ReIm[(n + 2) r E^(I u) - 2 r E^(I (1 + n/2) u)],
ReIm[(n + 2) r E^(I u) + 2 r E^(I (1 + n/2) u)]}],
{u, 0, 2 Denominator[n] π, (2 Denominator[n] π)/(m - 1)}]}]]

Still another neat demonstration is the Bernoulli-Euler double generation theorem: an epicycloid is equivalent to a pericycloid (which can be thought of as the locus of a point mounted on a "hula hoop").
With[{n = 3, r = 1, m = 31},
Animate[{ParametricPlot[ReIm[(n + 1) r E^(I t) - r E^(I (n + 1) t)],
{t, -$MachineEpsilon, u}, Axes -> None,
Epilog -> {Thick, Circle[ReIm[(n + 1) r E^(I u)], r],
Line[{ReIm[(n + 1) r E^(I u)],
ReIm[(n + 1) r E^(I u) -
r E^(I (n + 1) u)]}],
{Directive[Red, PointSize[Large]],
Point[ReIm[(n + 1) r E^(I u) -
r E^(I (n + 1) u)]]}},
Frame -> True, PlotRange -> (n + 2) r,
PlotStyle -> Directive[Red, Thick],
Prolog -> {Directive[Blue, Thick], Circle[{0, 0}, n r]}],
ParametricPlot[ReIm[(n + 1) r E^(I t) - r E^(I (n + 1) t)],
{t, -$MachineEpsilon, u}, Axes -> None,
Epilog -> {Thick, Circle[ReIm[-r E^(I (n + 1) u)],
(n + 1) r],
Line[{ReIm[-r E^(I (n + 1) u)],
ReIm[(n + 1) r E^(I u) -
r E^(I (n + 1) u)]}],
{Directive[Red, PointSize[Large]],
Point[ReIm[(n + 1) r E^(I u) -
r E^(I (n + 1) u)]]}},
Frame -> True, PlotRange -> (n + 2) r,
PlotStyle -> Directive[Red, Thick],
Prolog -> {Directive[Blue, Thick], Circle[{0, 0}, n r]}]}
// GraphicsRow, {u, 0, 2 Denominator[n] π, (2 Denominator[n] π)/(m - 1)}]]
