2
$\begingroup$

How can I make a moving point on the circle with control?

Manipulate[
       ParametricPlot[Sqrt[50]{Cos[x],Sin[x]},{x,0,10Pi},
       Epilog->{PointSize[Large], Point[Table[{2,0}]]}, 
       PlotRange->{{0,10},{0,10}}],{{Sqrt[50],2,"Play"}, 1, 10}
]
$\endgroup$
3
$\begingroup$

Example:

Manipulate[
 Graphics[{
   Circle[],
   {Red, PointSize @ .05, Point@{Cos[x], Sin[x]}}
   }],
 {x, 0, 2 Pi}
 ]

Alternatively, if you would like to animate it:

Animate[
 Graphics[{
   Circle[],
   {Red, PointSize @ .05, Point@{Cos[x], Sin[x]}}
   }],
 {x, 0, 2 Pi}
 ]

Output:

output example

$\endgroup$
  • $\begingroup$ I'm extremly sorry, but can you give me the full code or explain where this part should be? $\endgroup$ – Mila May 8 '16 at 19:45
  • $\begingroup$ Oh, I understand. Thank you very much $\endgroup$ – Mila May 8 '16 at 19:46
  • $\begingroup$ You are welcome! There are two solutions (using Manipulate and using Animate), both visulize the same thing $\endgroup$ – e.doroskevic May 8 '16 at 19:48
2
$\begingroup$

Update:

Manipulate[ ParametricPlot[radius {Sin[x], Cos[x]}, {x, 0, 2 Pi}, 
    PlotRange -> {{-10, 10}, {-10, 10}}, MeshFunctions -> {#3 &}, 
    Axes -> True, Mesh -> {{{t, {Red, PointSize[.05]}}}}],
  {t, 0, 2 Pi}, {{radius, 2, "Play"}, 1, 10}]

enter image description here

Original post:

Using Clock and ParametricPlot with MeshFunctions

Dynamic@ParametricPlot[{Sin[x], Cos[x]}, {x, 0, 2 Pi}, 
  MeshFunctions -> {#3 &}, Axes -> False, 
  Mesh -> {{{Clock[{0, 2 Pi}], {Red, PointSize[.05]}}}}]

Using Clock and ParametricPlot with Epilog

Dynamic@ParametricPlot[{Sin[x], Cos[x]}, {x, 0, 2 Pi}, Axes -> False, 
  Epilog -> {PointSize[.05], Red, With[{c = Clock[{0, 2 Pi}]}, Point[{Sin[c], Cos[c]}]]}]

both give

enter image description here

Using Animate: Both MeshFunctions and Epilog methods above can be used with Animate or Manipulate:

Animate[ParametricPlot[{Sin[x], Cos[x]}, {x, 0, 2 Pi}, Axes -> False, 
   Epilog -> {PointSize[.05], Red, Point[{Sin[t], Cos[t]}]}], {t, 0, 
   2 Pi}]

Animate[ParametricPlot[{Sin[x], Cos[x]}, {x, 0, 2 Pi}, 
  MeshFunctions -> {#3 &}, Axes -> False, 
  Mesh -> {{{t, {Red, PointSize[.05]}}}}], {t, 0, 2 Pi}]

Mathematica graphics

(To get the Manipulate version just change Animate to Manipulate)

$\endgroup$
  • $\begingroup$ Thank you. But I need that code has a scale and the part of the circle moves({{Sqrt[50],2,"Play"}, 1, 10}). Can you hepl me with it? $\endgroup$ – Mila May 8 '16 at 21:38
  • $\begingroup$ @MIla, please see the update. By the way, Sqrt[50 is an unusal choice for a Manipulate variablename; to my surprise it works. I replaced it with radius. $\endgroup$ – kglr May 8 '16 at 21:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.