Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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.

share|improve this question
    
Welcome to Mathematia.SE! Please have a look at the FAQ to make the most of your experience here. –  Yves Klett Jan 3 '13 at 12:29
    
Have a good look at the help for Manipulate and Circle and Graphics. Also, the demonstrations site is bound to yield some relevant code... –  Yves Klett Jan 3 '13 at 12:31
    
In addition, it is always a good idea to post the code you´ve tried already so we get an idea how to best help you out. –  Yves Klett Jan 3 '13 at 12:38
1  
Thank you! I'll make sure to post my erroneous code in the future. And I'll definitely be spending time on that demonstrations site, it's awesome. –  kneu93 Jan 3 '13 at 12:41
    
You could (and should) still add your code to the question - this will help future visitors to make more quickly sense of this thread and see how PlotRange can help them in similar situations. –  Yves Klett Jan 3 '13 at 13:39

1 Answer 1

up vote 3 down vote accepted

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}]
share|improve this answer
    
Thank you, the missing PlotRange was exactly my issue. Thanks so much for the speedy response! –  kneu93 Jan 3 '13 at 12:44
    
I'm new too, and that was exactly the problem I had! –  nickjamesuk Jan 3 '13 at 12:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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