# How do I combine a manipulate equation and a circle equation?

Here is my code so far:

p1 =
Manipulate[
ParametricPlot[
{2(n - 1)Cos[t] + 2Cos[(n - 1)t], 2(n - 1)Sin[t] - 2Sin[(n - 1)t]},
{t, 0, 2 Pi}], {n, 2, 10, 1}]
p2 = ParametricPlot[{8 Cos[t], 8 Sin[t]}, {t, 0, 2π}]
Show[p1, p2]


but it just prints separate equations

Just put them in same Manipulate. Do not use output of Manipulate inside Show.

Manipulate[
Module[{p1, p2},
p2 = ParametricPlot[{8 Cos[t], 8 Sin[t]}, {t, 0, 2 \[Pi]}];
p1 = ParametricPlot[{2 (n - 1) Cos[t] + 2 Cos[(n - 1) t],
2 (n - 1) Sin[t] - 2 Sin[(n - 1) t]}, {t, 0, 2 Pi}];
Show[p2, p1]
],
{n, 2, 10, 1}
]


Or since p1 does not depend on n you can calculate it once

Manipulate[
Module[{p1,t},
p1 = ParametricPlot[{2 (n - 1) Cos[t] + 2 Cos[(n - 1) t],
2 (n - 1) Sin[t] - 2 Sin[(n - 1) t]}, {t, 0, 2 Pi}];
Show[p2, p1]
],
{n, 2, 10, 1},
Initialization :> (p2 =
ParametricPlot[{8 Cos[t], 8 Sin[t]}, {t, 0, 2 \[Pi]}])
]

• Thank you. That was very useful! – The Math Guy Apr 28 at 0:33

Actually, since ParametricPlot can display multiple parametric curves, you could just write this simple Manipulate expression:

Manipulate[
ParametricPlot[
{{2 (n - 1) Cos[t] + 2 Cos[(n - 1) t], 2 (n - 1) Sin[t] - 2 Sin[(n - 1) t]},
{8 Cos[t], 8 Sin[t]}},
{t, 0, 2 Pi}],
{n, 2, 10, 1}]