# Problem with manipulation and plot

I want to make my function trace the hypotrochoid through one period of its motion and trying to change the color of the trace, color of the radius, and change the color of the dot on it so I can view it easier

I have came up with this following function

 hypotrochoid[a_, b_, h_,t_] := {(a - b) Cos[t] + h Cos[(a - b)/b t], (a - b) Sin[t] -
h Sin[(a - b)/b t]};

myfigure[a_, b_, h_]:=Manipulate[ParametricPlot[hypotrochoid[a, b, h, t], {t, 0, c*2 \[Pi]},PlotRange -> {{-(a + b + h + 1/4), a + b + h + 1/4}, {-(a + b + h + 1/4), a + b + h + 1/4}}], {c, -1, 1}]


Though when I test it on

myfigure[5, 1, 1/2]


Nothing shows up on this testing. I know I do not have the coloring but not certain of the syntax require.

• Post complete code. Where's definition for hypotrochoid? – RunnyKine Nov 16 '13 at 4:57
• Posted forgot about that – thaibak527 Nov 16 '13 at 5:01
• It works for me. You may want to restart the kernel. – RunnyKine Nov 16 '13 at 5:04
• error message: ParametricPlot::prng: Value of option PlotRange -> {{-6,6},{{-6},6}} is not All, Full, Automatic, a positive machine number, or an appropriate list of range specifications. >> – thaibak527 Nov 16 '13 at 5:05
• Please restart your Mathematica session and try again. – RunnyKine Nov 16 '13 at 5:07

For coloring try:

myfigure[a_, b_, h_] := Manipulate[
ParametricPlot[
hypotrochoid[a, b, h, t], {t, 0.0000001, c*2 \[Pi]},
PlotRange -> {
{-(a + b + h + 1/4), a + b + h + 1/4},
{-(a + b + h + 1/4), a + b + h + 1/4}
},
PlotStyle -> plotColor,
Prolog -> {circleColor,
Circle[{0, 0}, a]},
Epilog -> {dotColor,
Disk[hypotrochoid[a, b, h, 2 Pi c ], .2]
}
],
{c, -1, 1},
{{plotColor, Red, "Trace"}, Red},
{{dotColor, Blue, "Dot"}, Blue},
{{circleColor, Gray, "Circle"}, Gray}
] • very nice...if it is not intrusive, what do you use for screen capture...do you then import into mathematica and convert to animated gif or use other converter? – ubpdqn Nov 17 '13 at 12:57
• @ubpdqn this one. Sometimes I import them for editing (removing frames from the end or beginning, for example). – cormullion Nov 17 '13 at 13:54
• Ah very nice, I'll go play around with that syntax and try some stuff, many thanks. – thaibak527 Nov 17 '13 at 21:09