Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Making an array of animations

I'm making a simple demo of the relationship between the unit circle and the sine function, like the one at http://treeblurb.com/dev_math/sin_canv00.html. I would like to plot the circle and function side by side, but graphics_array gives an error, saying that all its elements must be graphics. Is there anything I can do?

Here's the code as it now stands.

singraph=animate([point((i,sin(i)), color="green", size=50) + plot(sin(x),(0,2*pi)) for i in srange(0,2*pi,0.2)], xmin=0, xmax=7, ymin=-1, ymax=1, figsize=[2,2])
unitcircle = animate([point((cos(i),sin(i)), color="green", size=50) + circle((0,0),1, color="blue") for i in srange(0,2*pi,0.2)], figsize=[2,2])
singraph.show()
unitcircle.show()