# I'm not able to plot a point at the end of a circle

Here is my code for My Project.

Manipulate[
Show[ParametricPlot[{r1 Cos[w1 x] + r2  Cos[w2 x],
r1 Sin[w1 x] + r2 Sin[w2 x]}, {x, 0, t},
PlotRange -> 10 {{-1, 1}, {-1, 1}}, PlotLegends -> {"Moon"},
AxesLabel -> {"Time"}, PlotStyle -> {Thick, Red}],
ParametricPlot[{r1 Cos[w1 x], r1 Sin[w1 x]}, {x, 0, t},
PlotLegends -> {"Earth"}],
Graphics[{PointSize[Large], Blue,
Point[{r1 Cos[w1 x], r1 Sin[w1 x]}]}]],
{{t, 1, "Time"}, 0.01, 10 Pi, 0.01},
{{w1, 1, "Angular Velocity"}, 0.2, 5, 0.01},
{{r1, 2, "Radius"}, 0.2, 10, 0.01},
{{w2, 1, "Moon Angular Velocity"}, 0.2, 5, 0.01},
{{r2, 2, " Moon Radius"}, 0.2, 10, 0.01}]


What's the problem here?

• Try replacing x with t in in your Point[...] – banone Feb 7 at 8:53
• @banone Thanks! Is there any other way to plot point besides using Graphics here – kile Feb 7 at 8:58
• You could try ListPlot. It also goes well with Show. – banone Feb 7 at 9:06
• @banone how to adjust the size of this point in ListPlot? – kile Feb 7 at 12:30

Two alternative ways to show the moving point:

Use a single ParametricPlot for both curves and show the moving point using Epilog:

Manipulate[ParametricPlot[{{r1 Cos[w1 x], r1 Sin[w1 x]},
{r1 Cos[w1 x] + r2 Cos[w2 x], r1 Sin[w1 x] + r2 Sin[w2 x]}}, {x, 0, t},
PlotRange -> 10 {{-1, 1}, {-1, 1}},
PlotLegends -> {"Earth", "Moon"}, AxesLabel -> {"Time"},
PlotStyle -> { Automatic, Red}, BaseStyle -> Thick,
Epilog -> {PointSize[Large], Blue, Point[{r1 Cos[w1 t], r1 Sin[w1 t]}]}],
{{t, 1, "Time"}, 0.01, 10 Pi, 0.01},
{{w1, 1, "Angular Velocity"}, 0.2, 5, 0.01},
{{r1, 2, "Radius"}, 0.2, 10, 0.01},
{{w2, 1, "Moon Angular Velocity"}, 0.2, 5, 0.01},
{{r2, 2, " Moon Radius"}, 0.2, 10, 0.01}]


Alternatively, use separate ParametricPlots for earth and moon and use the options MeshFunctions, Mesh and MeshStyle in the first plot to show the moving point:

Manipulate[Show[ParametricPlot[{r1 Cos[w1 x], r1 Sin[w1 x]}, {x, 0, t},
PlotRange -> 10 {{-1, 1}, {-1, 1}}, PlotLegends -> {"Earth"},
AxesLabel -> {"Time"}, BaseStyle -> Thick,
MeshFunctions -> {#3 &}, Mesh -> {{t}},
MeshStyle -> Directive[PointSize[Large], Blue]],
ParametricPlot[{r1 Cos[w1 x] + r2 Cos[w2 x], r1 Sin[w1 x] + r2 Sin[w2 x]}, {x, 0, t},
PlotLegends -> {"Moon"}, PlotStyle -> Red, BaseStyle -> Thick]],
{{t, 1, "Time"}, 0.01, 10 Pi, 0.01},
{{w1, 1, "Angular Velocity"}, 0.2, 5, 0.01},
{{r1, 2, "Radius"}, 0.2, 10, 0.01},
{{w2, 1, "Moon Angular Velocity"}, 0.2, 5, 0.01},
{{r2, 2, " Moon Radius"}, 0.2, 10, 0.01}]


same picture

• Is there a way to add PlotLegends for Point? – kile Feb 8 at 9:37
• @kile, you can add styling directives (Opacity, PointSize, color, etc. ) before Point[...]. – kglr Feb 8 at 9:43
• I want an explaination in right side of the graph like what PlotLegends -> {"Earth", "Moon"} did here. For instance, red line means Moon – kile Feb 8 at 9:46
• Epilog -> {PointSize[Large], Blue, Point[{r1 Cos[w1 t], r1 Sin[w1 t]}], PlotLegends -> {"Earth"}} is not working – kile Feb 8 at 9:51
• @kile, that's a good question. You can not add legends inside Epilog. But you can change the PlotLegends in ParametricPlot to PlotLegends -> LineLegend[{ColorData[97]@1, Red, Blue}, {"Earth", "Moon", "third legend"}, Joined -> {True, True, False}, LegendMarkers -> {None, None, "Point"}] to get the desired result. – kglr Feb 8 at 10:31