Message Boards Message Boards

0
|
6165 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

animate a list of points on a unit circle

Posted 10 years ago

New to Mathematica, but I'm stuck on something that seems like it should be simple ... so I suspect I'm missing something fundamental. Here's the issue simplified. I'd like to plot 2 points on a circle. These points change with time, so I'd like to animate the graphic over a time series of 2.

Here are the points:

 m = {{{-0.755948, 0.654632}, {-0.625139, 0.780514}}, {{-0.821873,  0.56967}, {-0.766458, 0.642295}}}

m[[1]] is time 1; m[[2]] is time 2;

Here's my one-line program that fails in every permutation I've tried:

ListAnimate[Table[Graphics[Circle[], Point[m[[t]]]], {t, 1, 2}]]

Here's the error message for the program permutation listed above: "An improperly formatted option was encountered while reading a Graphics. The option was not in the form of a rule."

Any help would be most appreciated. Thanks!

POSTED BY: Gary Lewis
2 Replies
Posted 10 years ago

Thanks, Antonio! I appreciate your help.

The following seems to work fine:

ListAnimate[Table[Graphics[{Circle[{0, 0}, 1], {Red, PointSize[0.02], Point[m[[t]]]}}], {t, 1, 2}], AnimationRunning -> False]
POSTED BY: Gary Lewis

It looks like the only problem is that Graphics is expecting a list. Graphics takes 1 argument followed by any options, so all the graphics items need to be in a list as the first argument. Currently your Point is trying to be an option setting.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract