Basically, I want to move a graphic (such as a circle) along a given path (such as sin(x)). I was thinking that the trick might be making the x and y coordinates of the circle vary based on the equation, but I have not been able to make anything except a circle that just sits there.
1 Answer
$\begingroup$
$\endgroup$
2
You need to specify the PlotRange
:
f[x_] := Sin[x];
Manipulate[Graphics[{Circle[{x, f[x]}, 0.5]}, PlotRange -> {{0, 5}, {-2, 2}}], {x, 0, 5}]
-
$\begingroup$ Thank you, the missing PlotRange was exactly my issue. Thanks so much for the speedy response! $\endgroup$– kneu93Commented Jan 3, 2013 at 12:44
-
$\begingroup$ I'm new too, and that was exactly the problem I had! $\endgroup$ Commented Jan 3, 2013 at 12:45
Manipulate
andCircle
andGraphics
. Also, the demonstrations site is bound to yield some relevant code... $\endgroup$PlotRange
can help them in similar situations. $\endgroup$